Changeset View
Changeset View
Standalone View
Standalone View
src/versionbits.h
Show All 11 Lines | |||||
static const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4; | static const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4; | ||||
/** What bits to set in version for versionbits blocks */ | /** What bits to set in version for versionbits blocks */ | ||||
static const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL; | static const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL; | ||||
/** What bitmask determines whether versionbits is in use */ | /** What bitmask determines whether versionbits is in use */ | ||||
static const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL; | static const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL; | ||||
/** Total bits available for versionbits */ | /** Total bits available for versionbits */ | ||||
static const int32_t VERSIONBITS_NUM_BITS = 29; | static const int32_t VERSIONBITS_NUM_BITS = 29; | ||||
enum ThresholdState { | enum class ThresholdState { | ||||
THRESHOLD_DEFINED, | DEFINED, | ||||
THRESHOLD_STARTED, | STARTED, | ||||
THRESHOLD_LOCKED_IN, | LOCKED_IN, | ||||
THRESHOLD_ACTIVE, | ACTIVE, | ||||
THRESHOLD_FAILED, | FAILED, | ||||
}; | }; | ||||
// A map that gives the state for blocks whose height is a multiple of Period(). | // A map that gives the state for blocks whose height is a multiple of Period(). | ||||
// The map is indexed by the block's parent, however, so all keys in the map | // The map is indexed by the block's parent, however, so all keys in the map | ||||
// will either be nullptr or a block with (height + 1) % Period() == 0. | // will either be nullptr or a block with (height + 1) % Period() == 0. | ||||
typedef std::map<const CBlockIndex *, ThresholdState> ThresholdConditionCache; | typedef std::map<const CBlockIndex *, ThresholdState> ThresholdConditionCache; | ||||
struct BIP9DeploymentInfo { | struct BIP9DeploymentInfo { | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |