diff options
author | fanquake <fanquake@gmail.com> | 2022-08-17 14:02:14 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-08-17 14:07:41 +0100 |
commit | 95d4744f024f40ebf61b38a51083629830b6141b (patch) | |
tree | 9ef61bec60d6e081b9cce40f124cd2c71ce5cd89 /src/rpc | |
parent | 64f7a1940d738a9acd207883af1dfda3e00f4a21 (diff) | |
parent | 90a5dfa5098f142ba8b7b2f20eac31f4095ca583 (diff) |
Merge bitcoin/bitcoin#19391: RPC/Mining: Clean out pre-Segwit miner compatibility code
90a5dfa5098f142ba8b7b2f20eac31f4095ca583 RPC/Mining: Clean out pre-Segwit miner compatibility code (Luke Dashjr)
Pull request description:
This is dead code post-Segwit.
ACKs for top commit:
achow101:
ACK 90a5dfa5098f142ba8b7b2f20eac31f4095ca583
Tree-SHA512: 5970aa3548d2a7da7c6e83fb9b910529faab10251b115122cec833bb7d3a54c7cb0714c1a873807be04c7817bb827c7ece1e20e8fa4c907aa58688487d0ec44d
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/mining.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 2902b35865..e9663d38b4 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -598,7 +598,6 @@ static RPCHelpMan getblocktemplate() std::string strMode = "template"; UniValue lpval = NullUniValue; std::set<std::string> setClientRules; - int64_t nMaxVersionPreVB = -1; CChainState& active_chainstate = chainman.ActiveChainstate(); CChain& active_chain = active_chainstate.m_chain; if (!request.params[0].isNull()) @@ -650,12 +649,6 @@ static RPCHelpMan getblocktemplate() const UniValue& v = aClientRules[i]; setClientRules.insert(v.get_str()); } - } else { - // NOTE: It is important that this NOT be read if versionbits is supported - const UniValue& uvMaxVersion = find_value(oparam, "maxversion"); - if (uvMaxVersion.isNum()) { - nMaxVersionPreVB = uvMaxVersion.getInt<int64_t>(); - } } } @@ -863,7 +856,6 @@ static RPCHelpMan getblocktemplate() if (setClientRules.find(vbinfo.name) == setClientRules.end()) { // Not supported by the client; make sure it's safe to proceed if (!vbinfo.gbt_force) { - // If we do anything other than throw an exception here, be sure version/force isn't sent to old clients throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Support for '%s' rule requires explicit client support", vbinfo.name)); } } @@ -876,14 +868,6 @@ static RPCHelpMan getblocktemplate() result.pushKV("vbavailable", vbavailable); result.pushKV("vbrequired", int(0)); - if (nMaxVersionPreVB >= 2) { - // If VB is supported by the client, nMaxVersionPreVB is -1, so we won't get here - // Because BIP 34 changed how the generation transaction is serialized, we can only use version/force back to v2 blocks - // This is safe to do [otherwise-]unconditionally only because we are throwing an exception above if a non-force deployment gets activated - // Note that this can probably also be removed entirely after the first BIP9 non-force deployment (ie, probably segwit) gets activated - aMutable.push_back("version/force"); - } - result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex()); result.pushKV("transactions", transactions); result.pushKV("coinbaseaux", aux); |