pub struct ChainParams {
pub params: Params,
pub genesis: Block,
pub subsidy_halving_interval: u64,
pub pow_target_timespan: u64,
pub coinbase_maturity: u32,
pub segwit_activation_height: u32,
pub csv_activation_height: u32,
pub exceptions: HashMap<BlockHash, c_uint>,
pub network: Network,
pub enforce_bip94: bool,
}Expand description
This struct encapsulates all chain-specific parameters.
Fields§
§params: ParamsField to store parameters related to the chain consensus.
genesis: BlockThe network’s first block, also called genesis block.
subsidy_halving_interval: u64Interval of blocks until the block reward halves
pow_target_timespan: u64When we retarget we expect this many seconds to be elapsed since last time. If it’s more, we decrease difficulty, if it’s less we increase difficulty
coinbase_maturity: u32We wait this many blocks before a coinbase output can be spent
segwit_activation_height: u32The height at which segwit is activated
csv_activation_height: u32The height at which csv(CHECK_SEQUENCE_VERIFY) is activated
exceptions: HashMap<BlockHash, c_uint>A list of exceptions to the rules, where the key is the block hash and the value is the verification flags
network: NetworkThe network this chain params is for
enforce_bip94: boolWhether we should enforce BIP-094 “Testnet 4” rules
Implementations§
Source§impl ChainParams
impl ChainParams
Sourcepub fn get_assume_utreexo(
network: Network,
) -> Result<AssumeUtreexoValue, BlockchainError>
pub fn get_assume_utreexo( network: Network, ) -> Result<AssumeUtreexoValue, BlockchainError>
This method is called when Assume Utreexo is set to true. It means that the user will accept the hardcoded utreexo state for the specified block, if it is found in the best chain. We can then sync rapidly from this state.
Sourcepub fn get_assume_valid(
network: Network,
arg: AssumeValidArg,
) -> Result<Option<BlockHash>, BlockchainError>
pub fn get_assume_valid( network: Network, arg: AssumeValidArg, ) -> Result<Option<BlockHash>, BlockchainError>
This method is used to assume all the scripts up to a specific block in the chain as valid. It can be None (we will verify all the scripts), user input or hardcoded.
Trait Implementations§
Source§impl AsRef<Params> for ChainParams
impl AsRef<Params> for ChainParams
Source§impl Clone for ChainParams
impl Clone for ChainParams
Source§fn clone(&self) -> ChainParams
fn clone(&self) -> ChainParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChainParams
impl Debug for ChainParams
Auto Trait Implementations§
impl Freeze for ChainParams
impl RefUnwindSafe for ChainParams
impl Send for ChainParams
impl Sync for ChainParams
impl Unpin for ChainParams
impl UnwindSafe for ChainParams
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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