diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ee3da4e523..4fa9e7927a 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -165,6 +165,13 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 4032; consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 3226; // 80% of 4032 + // Deployment of BIP147 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1519952400; // Feb 30th, 2018 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1551488400; // Feb 30th, 2019 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 4032; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 3226; // 80% of 4032 + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000100a308553b4863b755"); // 782700 @@ -307,6 +314,13 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 100; consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 50; // 50% of 100 + // Deployment of BIP147 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1517792400; // Feb 5th, 2018 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1549328400; // Feb 5th, 2019 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 100; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 59; // 50% of 100 + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000924e924a21715"); // 37900 @@ -426,6 +440,13 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 100; consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 50; // 50% of 100 + // Deployment of BIP147 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1517792400; // Feb 5th, 2018 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1549328400; // Feb 5th, 2019 + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nWindowSize = 100; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nThreshold = 59; // 50% of 100 + // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000"); @@ -539,6 +560,9 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].bit = 1; consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 0; consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 999999999999ULL; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].bit = 2; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 0; + consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 999999999999ULL; // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00"); diff --git a/src/consensus/params.h b/src/consensus/params.h index 741b1e76e0..0878becc27 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -17,6 +17,7 @@ enum DeploymentPos DEPLOYMENT_TESTDUMMY, DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113. DEPLOYMENT_DIP0001, // Deployment of DIP0001 and lower transaction fees. + DEPLOYMENT_BIP147, // Deployment of BIP147 (NULLDUMMY) // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp MAX_VERSION_BITS_DEPLOYMENTS }; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 88685fc977..91e0fc77e7 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1270,6 +1270,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) softforks.push_back(SoftForkDesc("bip65", 4, tip, consensusParams)); BIP9SoftForkDescPushBack(bip9_softforks, "csv", consensusParams, Consensus::DEPLOYMENT_CSV); BIP9SoftForkDescPushBack(bip9_softforks, "dip0001", consensusParams, Consensus::DEPLOYMENT_DIP0001); + BIP9SoftForkDescPushBack(bip9_softforks, "bip147", consensusParams, Consensus::DEPLOYMENT_BIP147); obj.push_back(Pair("softforks", softforks)); obj.push_back(Pair("bip9_softforks", bip9_softforks)); diff --git a/src/validation.cpp b/src/validation.cpp index fb55dc239a..6453079eab 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2131,6 +2131,10 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE; } + if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_BIP147, versionbitscache) == THRESHOLD_ACTIVE) { + flags |= SCRIPT_VERIFY_NULLDUMMY; + } + int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1; LogPrint("bench", " - Fork checks: %.2fms [%.2fs]\n", 0.001 * (nTime2 - nTime1), nTimeForks * 0.000001); diff --git a/src/versionbits.cpp b/src/versionbits.cpp index b746e7178c..fbbcdb4278 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -21,6 +21,11 @@ const struct BIP9DeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION /*.name =*/ "dip0001", /*.gbt_force =*/ true, /*.check_mn_protocol =*/ true, + }, + { + /*.name =*/ "bip147", + /*.gbt_force =*/ true, + /*.check_mn_protocol =*/ false, } };