pub struct BlockContext<'a> {
pub opts: Options,
pub pow_verifier: fn(&BlockHeader) -> Result<(), Error>,
pub header_allowed: Box<dyn Fn(&BlockHeader) -> Result<(), Error>>,
pub txhashset: &'a mut TxHashSet,
pub header_pmmr: &'a mut PMMRHandle<BlockHeader>,
pub batch: Batch<'a>,
}Expand description
Contextual information required to process a new block and either reject or accept it.
Fields§
§opts: OptionsThe options
pow_verifier: fn(&BlockHeader) -> Result<(), Error>The pow verifier to use when processing a block.
header_allowed: Box<dyn Fn(&BlockHeader) -> Result<(), Error>>Custom fn allowing arbitrary header validation rules (denylist) to be applied.
txhashset: &'a mut TxHashSetThe active txhashset (rewindable MMRs) to use for block processing.
header_pmmr: &'a mut PMMRHandle<BlockHeader>The active header MMR handle.
batch: Batch<'a>The active batch to use for block processing.
Auto Trait Implementations§
impl<'a> !Freeze for BlockContext<'a>
impl<'a> !RefUnwindSafe for BlockContext<'a>
impl<'a> !Send for BlockContext<'a>
impl<'a> !Sync for BlockContext<'a>
impl<'a> Unpin for BlockContext<'a>
impl<'a> !UnwindSafe for BlockContext<'a>
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
Mutably borrows from an owned value. Read more
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>
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 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>
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