pub struct ScriptCheckQueue { /* private fields */ }Expand description
Script verification queue: N-1 dedicated workers + master joins.
Implementations§
Source§impl ScriptCheckQueue
impl ScriptCheckQueue
Sourcepub fn new(worker_count: usize, batch_size: Option<usize>) -> Self
pub fn new(worker_count: usize, batch_size: Option<usize>) -> Self
Create queue with worker_count dedicated threads (par-1; master joins for total par).
batch_size: from ibd_tuning (default 128). Use None for default.
Sourcepub fn run_check_with_refs(
check: &ScriptCheck,
session: &BlockSessionContext,
ctx: &TxScriptContext,
refs: &[&[u8]],
buffer: &[u8],
p2pkh_hash: Option<[u8; 20]>,
script_pubkey_prefetched: Option<&[u8]>,
prevout_values_prefetched: Option<&[i64]>,
) -> Result<bool, ConsensusError>
pub fn run_check_with_refs( check: &ScriptCheck, session: &BlockSessionContext, ctx: &TxScriptContext, refs: &[&[u8]], buffer: &[u8], p2pkh_hash: Option<[u8; 20]>, script_pubkey_prefetched: Option<&[u8]>, prevout_values_prefetched: Option<&[i64]>, ) -> Result<bool, ConsensusError>
Run a single check with pre-built refs (used when refs are cached per tx_ctx). p2pkh_hash: when Some, P2PKH fast path skips HASH160 (batch path). When script_pubkey and prevout_values are Some, skips per-check lock acquisitions (batch path).
Sourcepub fn start_session(&self, session: BlockSessionContext)
pub fn start_session(&self, session: BlockSessionContext)
Start a block session. Must be called before any Add. Session holds shared context.
Sourcepub fn add(&self, checks: Vec<ScriptCheck>)
pub fn add(&self, checks: Vec<ScriptCheck>)
Add checks to the queue; workers wake and process.
Sourcepub fn add_from_slice(&self, checks: &[ScriptCheck])
pub fn add_from_slice(&self, checks: &[ScriptCheck])
Add checks from a slice without consuming. Used with block-level pre-allocated Vec (Q).
Sourcepub fn run_checks_sequential(
checks: &[ScriptCheck],
session: &BlockSessionContext,
) -> Result<Vec<(usize, bool)>>
pub fn run_checks_sequential( checks: &[ScriptCheck], session: &BlockSessionContext, ) -> Result<Vec<(usize, bool)>>
Run checks sequentially on the current thread (fallback when parallel retry fails).
Auto Trait Implementations§
impl !Freeze for ScriptCheckQueue
impl !RefUnwindSafe for ScriptCheckQueue
impl Send for ScriptCheckQueue
impl Sync for ScriptCheckQueue
impl Unpin for ScriptCheckQueue
impl UnsafeUnpin for ScriptCheckQueue
impl !UnwindSafe for ScriptCheckQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more