5#ifndef BITCOIN_VERSIONBITS_H
6#define BITCOIN_VERSIONBITS_H
80 std::array<ThresholdConditionCache,VERSIONBITS_NUM_BITS> m_warning_caches
GUARDED_BY(
m_mutex);
81 std::array<ThresholdConditionCache,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> m_caches
GUARDED_BY(
m_mutex);
The block chain is a tree shaped structure starting with the genesis block at the root,...
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
BIP 9 allows multiple softforks to be deployed in parallel.
BIP9GBTStatus GBTStatus(const CBlockIndex &block_index, const Consensus::Params ¶ms) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Determine what nVersion a new block should use.
std::vector< std::pair< int, bool > > CheckUnknownActivations(const CBlockIndex *pindex, const CChainParams &chainparams) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Check for unknown activations Returns a vector containing the bit number used for signalling and a bo...
std::array< ThresholdConditionCache, Consensus::MAX_VERSION_BITS_DEPLOYMENTS > m_caches GUARDED_BY(m_mutex)
BIP9Info Info(const CBlockIndex &block_index, const Consensus::Params ¶ms, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
void Clear() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
std::array< ThresholdConditionCache, VERSIONBITS_NUM_BITS > m_warning_caches GUARDED_BY(m_mutex)
bool IsActiveAfter(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Get the BIP9 state for a given deployment for the block after pindexPrev.
std::map< std::string, const Info, std::less<> > signalling
std::map< std::string, const Info, std::less<> > active
std::map< std::string, const Info, std::less<> > locked_in
Detailed status of an enabled BIP9 deployment.
std::string current_state
String representing the current state.
std::vector< bool > signalling_blocks
Which blocks signalled; empty if signalling is not applicable.
int since
Height at which current_state started.
std::string next_state
String representing the next block's state.
std::optional< BIP9Stats > stats
For states where signalling is applicable, information about the signalling.
std::optional< int > active_since
Height at which the deployment is active, if known.
Display status of an in-progress BIP9 softfork.
uint32_t count
Number of blocks with the version bit set since the beginning of the current period.
uint32_t threshold
Number of blocks with the version bit set required to activate the softfork.
uint32_t elapsed
Number of blocks elapsed since the beginning of the current period.
bool possible
False if there are not enough blocks left in this period to pass activation threshold.
uint32_t period
Length of blocks of the BIP9 signalling period.
Parameters that influence chain consensus.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
std::map< const CBlockIndex *, ThresholdState > ThresholdConditionCache
static const int32_t VERSIONBITS_NUM_BITS
Total bits available for versionbits.
static const int32_t VERSIONBITS_TOP_BITS
What bits to set in version for versionbits blocks.
static const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION
What block version to use for new blocks (pre versionbits)
static const int32_t VERSIONBITS_TOP_MASK
What bitmask determines whether versionbits is in use.
ThresholdState
BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.