Skip to main content

ScriptCheckQueue

Struct ScriptCheckQueue 

Source
pub struct ScriptCheckQueue { /* private fields */ }
Expand description

Script verification queue: N-1 dedicated workers + master joins.

Implementations§

Source§

impl ScriptCheckQueue

Source

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.

Source

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).

Source

pub fn start_session(&self, session: BlockSessionContext)

Start a block session. Must be called before any Add. Session holds shared context.

Source

pub fn add(&self, checks: Vec<ScriptCheck>)

Add checks to the queue; workers wake and process.

Source

pub fn add_from_slice(&self, checks: &[ScriptCheck])

Add checks from a slice without consuming. Used with block-level pre-allocated Vec (Q).

Source

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).

Source

pub fn complete(&self) -> Result<Vec<(usize, bool)>>

Master joins until queue empty; returns collected (tx_ctx_idx, valid) results.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V