Changeset View
Changeset View
Standalone View
Standalone View
src/versionbits.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | protected: | ||||
bool Condition(const CBlockIndex *pindex, | bool Condition(const CBlockIndex *pindex, | ||||
const Consensus::Params ¶ms) const override { | const Consensus::Params ¶ms) const override { | ||||
return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == | return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == | ||||
VERSIONBITS_TOP_BITS) && | VERSIONBITS_TOP_BITS) && | ||||
(pindex->nVersion & Mask(params)) != 0); | (pindex->nVersion & Mask(params)) != 0); | ||||
} | } | ||||
public: | public: | ||||
VersionBitsConditionChecker(Consensus::DeploymentPos id_) : id(id_) {} | explicit VersionBitsConditionChecker(Consensus::DeploymentPos id_) | ||||
: id(id_) {} | |||||
uint32_t Mask(const Consensus::Params ¶ms) const { | uint32_t Mask(const Consensus::Params ¶ms) const { | ||||
return ((uint32_t)1) << params.vDeployments[id].bit; | return ((uint32_t)1) << params.vDeployments[id].bit; | ||||
} | } | ||||
}; | }; | ||||
} // namespace | } // namespace | ||||
ThresholdState VersionBitsState(const CBlockIndex *pindexPrev, | ThresholdState VersionBitsState(const CBlockIndex *pindexPrev, | ||||
const Consensus::Params ¶ms, | const Consensus::Params ¶ms, | ||||
Show All 24 Lines |