Ignore old versionbit activations

Adds a hardcoded height to the consensus chain parameters for
ignoring versionbit activations prior to a fixed height.
This commit is contained in:
Anthony Towns
2019-09-06 00:28:52 +10:00
committed by John Newbery
parent 5e202382a9
commit fdb3e8f8b2
3 changed files with 8 additions and 1 deletions

View File

@@ -1625,7 +1625,8 @@ public:
bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override
{
return ((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) &&
return pindex->nHeight >= params.MinBIP9WarningHeight &&
((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) &&
((pindex->nVersion >> bit) & 1) != 0 &&
((ComputeBlockVersion(pindex->pprev, params) >> bit) & 1) == 0;
}