diff options
| author | Patrick Lodder <[email protected]> | 2021-02-13 17:21:20 +0100 |
|---|---|---|
| committer | Patrick Lodder <[email protected]> | 2021-02-13 17:24:55 +0100 |
| commit | 0c600d7f9d832836a9389bf77918472beeb23907 (patch) | |
| tree | e9fbb3dd6b74b34a58e0854fdf3c329cd2e13e0a /src/validation.cpp | |
| parent | Merge pull request #1705 from rnicoll/block-download-timeout (diff) | |
| download | discoin-0c600d7f9d832836a9389bf77918472beeb23907.tar.xz discoin-0c600d7f9d832836a9389bf77918472beeb23907.zip | |
Fixate BIP65 softfork heights
- Re-introduce Params.BIP65Height
- Fixate block 1854705 for testnet
- Fixate block 3464751 for mainnet
- Fixate block 1351 for regtest
- Stop using IsSuperMajority() in validation for BIP65
- Simplify RPC SoftForkMajorityDesc
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 3ddf67717..a30ee2ef0 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1852,9 +1852,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin flags |= SCRIPT_VERIFY_DERSIG; } - // Start enforcing CHECKLOCKTIMEVERIFY, (BIP65) for block.nVersion=4 - // blocks, when 75% of the network has upgraded: - if (block.GetBaseVersion() >= 4 && IsSuperMajority(4, pindex->pprev, chainparams.GetConsensus(0).nMajorityEnforceBlockUpgrade, chainparams.GetConsensus(0))) { + // Start enforcing CHECKLOCKTIMEVERIFY, (BIP65) for block.nVersion=4 blocks + if (pindex->nHeight >= chainparams.GetConsensus(0).BIP65Height) { flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY; } @@ -3035,15 +3034,11 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta // Reject outdated version blocks when 95% (75% on testnet) of the network has upgraded: // check for version 2, 3 and 4 upgrades // Dogecoin: Version 2 enforcement was never used - if((block.GetBaseVersion() < 3 && nHeight >= consensusParams.BIP66Height)) + if((block.GetBaseVersion() < 3 && nHeight >= consensusParams.BIP66Height) || + (block.GetBaseVersion() < 4 && nHeight >= consensusParams.BIP65Height)) return state.Invalid(false, REJECT_OBSOLETE, strprintf("bad-version(0x%08x)", block.GetBaseVersion()), strprintf("rejected nVersion=0x%08x block", block.GetBaseVersion())); - // Dogecoin: Introduce supermajority rules for v4 blocks - if (block.GetBaseVersion() < 4 && IsSuperMajority(4, pindexPrev, consensusParams.nMajorityRejectBlockOutdated, consensusParams)) - return state.Invalid(error("%s : rejected nVersion=3 block", __func__), - REJECT_OBSOLETE, "bad-version"); - return true; } |