5 #ifndef BITCOIN_VERSIONBITS_H
6 #define BITCOIN_VERSIONBITS_H
88 #endif // BITCOIN_VERSIONBITS_H
Display status of an in-progress BIP9 softfork.
ThresholdState GetStateFor(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, ThresholdConditionCache &cache) const
Returns the state for pindex A based on parent pindexPrev B.
virtual int64_t EndTime(const Consensus::Params ¶ms) const =0
static const int32_t VERSIONBITS_TOP_MASK
What bitmask determines whether versionbits is in use.
virtual bool Condition(const CBlockIndex *pindex, const Consensus::Params ¶ms) const =0
ThresholdConditionCache caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
ThresholdState
BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.
int threshold
Number of blocks with the version bit set required to activate the softfork.
int GetStateSinceHeightFor(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, ThresholdConditionCache &cache) const
Returns the height since when the ThresholdState has started for pindex A based on parent pindexPrev ...
BIP9Stats VersionBitsStatistics(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos)
BIP 9 allows multiple softforks to be deployed in parallel.
int period
Length of blocks of the BIP9 signalling period.
ThresholdState VersionBitsState(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos, VersionBitsCache &cache)
Abstract class that implements BIP9-style threshold logic, and caches results.
virtual int MinActivationHeight(const Consensus::Params ¶ms) const
BIP9Stats GetStateStatisticsFor(const CBlockIndex *pindex, const Consensus::Params ¶ms) const
Returns the numerical statistics of an in-progress BIP9 softfork in the current period.
int count
Number of blocks with the version bit set since the beginning of the current period.
Parameters that influence chain consensus.
virtual int Threshold(const Consensus::Params ¶ms) const =0
std::map< const CBlockIndex *, ThresholdState > ThresholdConditionCache
int VersionBitsStateSinceHeight(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos, VersionBitsCache &cache)
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.
virtual int64_t BeginTime(const Consensus::Params ¶ms) const =0
int 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.
virtual int Period(const Consensus::Params ¶ms) const =0
uint32_t VersionBitsMask(const Consensus::Params ¶ms, Consensus::DeploymentPos pos)
static const int32_t VERSIONBITS_NUM_BITS
Total bits available for versionbits.