pub struct BlockValidationContext {
pub time_context: Option<TimeContext>,
pub network_time: u64,
pub network: Network,
pub activation: ForkActivationTable,
pub bip54_boundary: Option<Bip54BoundaryTimestamps>,
}Expand description
Block validation context: time, network, fork activation, and optional rule data.
Built by the node from headers, clock, chain params, version-bits, and config. Consensus only reads; it does not compute activation or read config.
Fields§
§time_context: Option<TimeContext>Time context for BIP113 and future-block checks.
network_time: u64Network time (Unix timestamp). Used when time_context is None for 2-week skip.
network: NetworkNetwork (mainnet / testnet / regtest).
activation: ForkActivationTablePrecomputed fork activation table.
bip54_boundary: Option<Bip54BoundaryTimestamps>When BIP54 is active and block is at period boundary, timestamps for timewarp; else None.
Implementations§
Source§impl BlockValidationContext
impl BlockValidationContext
Sourcepub fn from_connect_block_ibd_args<H: AsRef<BlockHeader>>(
recent_headers: Option<&[H]>,
network_time: u64,
network: Network,
bip54_activation_override: Option<u64>,
bip54_boundary: Option<Bip54BoundaryTimestamps>,
) -> Self
pub fn from_connect_block_ibd_args<H: AsRef<BlockHeader>>( recent_headers: Option<&[H]>, network_time: u64, network: Network, bip54_activation_override: Option<u64>, bip54_boundary: Option<Bip54BoundaryTimestamps>, ) -> Self
Build context from the same inputs as connect_block_ibd (for migration).
Sourcepub fn from_time_context_and_network(
time_context: Option<TimeContext>,
network: Network,
bip54_boundary: Option<Bip54BoundaryTimestamps>,
) -> Self
pub fn from_time_context_and_network( time_context: Option<TimeContext>, network: Network, bip54_boundary: Option<Bip54BoundaryTimestamps>, ) -> Self
Build context from precomputed time context and network.
Sourcepub fn for_network(network: Network) -> Self
pub fn for_network(network: Network) -> Self
Build context for a network only (no headers, network_time 0, no BIP54). For tests and simple callers.
Trait Implementations§
Source§impl Clone for BlockValidationContext
impl Clone for BlockValidationContext
Source§fn clone(&self) -> BlockValidationContext
fn clone(&self) -> BlockValidationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BlockValidationContext
impl RefUnwindSafe for BlockValidationContext
impl Send for BlockValidationContext
impl Sync for BlockValidationContext
impl Unpin for BlockValidationContext
impl UnsafeUnpin for BlockValidationContext
impl UnwindSafe for BlockValidationContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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