pub struct BlockValidationContext {
pub time_context: Option<TimeContext>,
pub network_time: u64,
pub network: Network,
pub activation: ForkActivationTable,
pub bip54_boundary: Option<Bip54BoundaryTimestamps>,
pub signet_challenge: Option<Vec<u8>>,
}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.
signet_challenge: Option<Vec<u8>>Optional signet challenge script override (BIP325); default from signet::default_signet_challenge.
Implementations§
Source§impl BlockValidationContext
impl BlockValidationContext
Sourcepub fn from_connect_block_ibd_args<H>(
recent_headers: Option<&[H]>,
network_time: u64,
network: Network,
bip54_activation_override: Option<u64>,
bip54_boundary: Option<Bip54BoundaryTimestamps>,
) -> BlockValidationContextwhere
H: AsRef<BlockHeader>,
pub fn from_connect_block_ibd_args<H>(
recent_headers: Option<&[H]>,
network_time: u64,
network: Network,
bip54_activation_override: Option<u64>,
bip54_boundary: Option<Bip54BoundaryTimestamps>,
) -> BlockValidationContextwhere
H: AsRef<BlockHeader>,
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>,
) -> BlockValidationContext
pub fn from_time_context_and_network( time_context: Option<TimeContext>, network: Network, bip54_boundary: Option<Bip54BoundaryTimestamps>, ) -> BlockValidationContext
Build context from precomputed time context and network.
Sourcepub fn for_network(network: Network) -> BlockValidationContext
pub fn for_network(network: Network) -> BlockValidationContext
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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