From 057eb0812d5e760d244772effddff9d282198b3a Mon Sep 17 00:00:00 2001 From: Sjors Date: Thu, 31 Aug 2017 17:35:04 +0200 Subject: [PATCH] Consensus: always apply BIP65 --- src/chainparams.cpp | 6 ------ src/consensus/params.h | 2 -- src/policy/policy.h | 1 - src/rpc/blockchain.cpp | 3 --- src/script/interpreter.cpp | 8 -------- src/validation.cpp | 5 ----- 6 files changed, 25 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ddd96895788d..5b918fecec96 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -65,8 +65,6 @@ class CMainParams : public CChainParams { strNetworkID = "main"; consensus.BIP34Height = 227931; consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); - consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0 - consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931 consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; @@ -152,8 +150,6 @@ class CTestNetParams : public CChainParams { strNetworkID = "test"; consensus.BIP34Height = 21111; consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); - consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6 - consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182 consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; @@ -234,8 +230,6 @@ class CRegTestParams : public CChainParams { strNetworkID = "regtest"; consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests) consensus.BIP34Hash = uint256(); - consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests) - consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests) consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; diff --git a/src/consensus/params.h b/src/consensus/params.h index 6f4c6387f2a5..e69448bfef20 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -41,8 +41,6 @@ struct Params { /** Block height and hash at which BIP34 becomes active */ int BIP34Height; uint256 BIP34Hash; - /** Block height at which BIP65 becomes active */ - int BIP65Height; /** Block height at which BIP66 becomes active */ int BIP66Height; /** diff --git a/src/policy/policy.h b/src/policy/policy.h index 9b1323ac26f3..25073a488374 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -60,7 +60,6 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_MINIMALIF | SCRIPT_VERIFY_NULLFAIL | - SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | SCRIPT_VERIFY_CHECKSEQUENCEVERIFY | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_WITNESS | diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index d3f1728890ca..e1e61ce2d670 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -973,9 +973,6 @@ static UniValue SoftForkMajorityDesc(int version, CBlockIndex* pindex, const Con case 3: activated = pindex->nHeight >= consensusParams.BIP66Height; break; - case 4: - activated = pindex->nHeight >= consensusParams.BIP65Height; - break; } rv.push_back(Pair("status", activated)); return rv; diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index f9b783588283..6e91b552b8d1 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -349,14 +349,6 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_CHECKLOCKTIMEVERIFY: { - if (!(flags & SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) { - // not enabled; treat as a NOP2 - if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) { - return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS); - } - break; - } - if (stack.size() < 1) return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); diff --git a/src/validation.cpp b/src/validation.cpp index cf8d284bc6fa..55a75824dc99 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1751,11 +1751,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin flags |= SCRIPT_VERIFY_DERSIG; } - // Start enforcing CHECKLOCKTIMEVERIFY (BIP65) rule - if (pindex->nHeight >= chainparams.GetConsensus().BIP65Height) { - flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY; - } - // Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic. int nLockTimeFlags = 0; if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {