From 0328dcdcfcb56dc8918697716d7686be048ad0b3 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 20 May 2019 14:59:07 -0400 Subject: [Consensus] Bury segwit deployment Hardcode segwit deployment height to 481824 for mainnet. --- src/rpc/blockchain.cpp | 2 +- src/rpc/mining.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 808324afea..cd98b6c1bc 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1338,7 +1338,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) BuriedForkDescPushBack(softforks, "bip66", consensusParams.BIP66Height); BuriedForkDescPushBack(softforks, "bip65", consensusParams.BIP65Height); BuriedForkDescPushBack(softforks, "csv", consensusParams.CSVHeight); - BIP9SoftForkDescPushBack(softforks, "segwit", consensusParams, Consensus::DEPLOYMENT_SEGWIT); + BuriedForkDescPushBack(softforks, "segwit", consensusParams.SegwitHeight); BIP9SoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY); obj.pushKV("softforks", softforks); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 48bc88823a..13bf611d32 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -482,9 +482,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) // TODO: Maybe recheck connections/IBD and (if something wrong) send an expires-immediately template to stop miners? } - const struct VBDeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT]; // GBT must be called with 'segwit' set in the rules - if (setClientRules.count(segwit_info.name) != 1) { + if (setClientRules.count("segwit") != 1) { throw JSONRPCError(RPC_INVALID_PARAMETER, "getblocktemplate must be called with the segwit rule set (call with {\"rules\": [\"segwit\"]})"); } @@ -521,7 +520,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) pblock->nNonce = 0; // NOTE: If at some point we support pre-segwit miners post-segwit-activation, this needs to take segwit support into consideration - const bool fPreSegWit = (ThresholdState::ACTIVE != VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache)); + const bool fPreSegWit = (pindexPrev->nHeight + 1 < consensusParams.SegwitHeight); UniValue aCaps(UniValue::VARR); aCaps.push_back("proposal"); -- cgit v1.2.3