5 #ifndef BITCOIN_CONSENSUS_VERSIONBITS
6 #define BITCOIN_CONSENSUS_VERSIONBITS
12 static const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4;
14 static const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL;
16 static const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL;
18 static const int32_t VERSIONBITS_NUM_BITS = 29;
Abstract class that implements BIP9-style threshold logic, and caches results.
virtual bool Condition(const CBlockIndex *pindex, const Consensus::Params ¶ms) const =0
virtual int Period(const Consensus::Params ¶ms) const =0
ThresholdState GetStateFor(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, ThresholdConditionCache &cache) const
virtual int64_t EndTime(const Consensus::Params ¶ms) const =0
int GetStateSinceHeightFor(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, ThresholdConditionCache &cache) const
virtual int64_t BeginTime(const Consensus::Params ¶ms) const =0
virtual int Threshold(const Consensus::Params ¶ms) const =0
The block chain is a tree shaped structure starting with the genesis block at the root,...
@ MAX_VERSION_BITS_DEPLOYMENTS
const char * name
Deployment name.
bool gbt_force
Whether GBT clients can safely ignore this rule in simplified usage.
Parameters that influence chain consensus.
ThresholdConditionCache caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
std::map< const CBlockIndex *, ThresholdState > ThresholdConditionCache
uint32_t VersionBitsMask(const Consensus::Params ¶ms, Consensus::DeploymentPos pos)
const struct BIP9DeploymentInfo VersionBitsDeploymentInfo[]
int VersionBitsStateSinceHeight(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos, VersionBitsCache &cache)
ThresholdState VersionBitsState(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos, VersionBitsCache &cache)