5 #ifndef BITCOIN_VERSIONBITS_H 6 #define BITCOIN_VERSIONBITS_H 33 typedef std::map<const CBlockIndex*, ThresholdState> ThresholdConditionCache;
40 uint32_t threshold{0};
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);
102 #endif // BITCOIN_VERSIONBITS_H
Opaque type for BIP9 state.
ThresholdState
BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.
std::map< std::string, const Info, std::less<> > locked_in
static const int32_t VERSIONBITS_TOP_MASK
What bitmask determines whether versionbits is in use.
std::vector< bool > signalling_blocks
Which blocks signalled; empty if signalling is not applicable.
std::map< std::string, const Info, std::less<> > active
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
void Clear() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
std::string next_state
String representing the next block's state.
std::string current_state
String representing the current state.
std::array< ThresholdConditionCache, VERSIONBITS_NUM_BITS > m_warning_caches GUARDED_BY(m_mutex)
std::optional< int > active_since
Height at which the deployment is active, if known.
int since
Height at which current_state started.
Parameters that influence chain consensus.
int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Determine what nVersion a new block should use.
BIP 9 allows multiple softforks to be deployed in parallel.
std::map< std::string, const Info, std::less<> > signalling
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Detailed status of an enabled BIP9 deployment.
The block chain is a tree shaped structure starting with the genesis block at the root...
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_BITS
What bits to set in version for versionbits blocks.
BIP9Info Info(const CBlockIndex &block_index, const Consensus::Params ¶ms, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
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...
static const int32_t VERSIONBITS_NUM_BITS
Total bits available for versionbits.
std::optional< BIP9Stats > stats
For states where signalling is applicable, information about the signalling.
BIP9GBTStatus GBTStatus(const CBlockIndex &block_index, const Consensus::Params ¶ms) EXCLUSIVE_LOCKS_REQUIRED(!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.