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) -> AssumeUtreexoValue
pub fn get_assume_utreexo(network: Network) -> AssumeUtreexoValue
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,
) -> Option<BlockHash>
pub fn get_assume_valid( network: Network, arg: AssumeValidArg, ) -> Option<BlockHash>
Returns the [BlockHash] to use as the assume-valid checkpoint,
or None if script validation should run on all blocks.
Blocks at and before this checkpoint skip script execution during IBD. This argument does not influence chain selection; if the best chain doesn’t include this block, we will verify all the historical scripts.
§Variants
AssumeValidArg::Disabled— no checkpoint; all scripts are validated.AssumeValidArg::UserInput— use the provided hash.AssumeValidArg::Hardcoded— use a release-time checkpoint per [Network]:
Sourcepub fn get_validation_flags(&self, height: u32, hash: BlockHash) -> c_uint
pub fn get_validation_flags(&self, height: u32, hash: BlockHash) -> c_uint
Returns the validation flags for a given block hash and height
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 more