diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-06-02 17:55:16 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-06-02 17:55:19 -0400 |
commit | e42c959c1dccf91d1e4bb20a502a3e4590ad279b (patch) | |
tree | bd6979bf529d28f3f2f215dae2a6cfa61e2c1c6a | |
parent | a62f0ed64f8bbbdfe6467ac5ce92ef5b5222d1bd (diff) | |
parent | 412d5fe8791c417bf46fc55a5bb8d59be98a33db (diff) |
Merge #19019: [0.20] Fix GBT: Restore "!segwit" and "csv" to "rules" key
412d5fe8791c417bf46fc55a5bb8d59be98a33db QA: feature_segwit: Check that template "rules" includes "!segwit" as appropriate (Luke Dashjr)
2abe8cc3b760219cfa434e4c96e9f8d3611d0037 Bugfix: Include "csv","!segwit" in "rules" (Luke Dashjr)
Pull request description:
Original branch merges cleanly (no rebase needed)
See also #17946
ACKs for top commit:
jnewbery:
utACK 412d5fe8791c417bf46fc55a5bb8d59be98a33db
Tree-SHA512: 8b269f7782c10f02dc245cc377d91f594474eade6a32184a49fa2ed3928d91917e4b83eefee6947bfb5ffff54eca2781f8cf2169c1f0ad3fefca1d4b3cf304dd
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rwxr-xr-x | test/functional/feature_segwit.py | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 94590e0da4..5a0af2a056 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -637,6 +637,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) result.pushKV("capabilities", aCaps); UniValue aRules(UniValue::VARR); + aRules.push_back("csv"); + if (!fPreSegWit) aRules.push_back("!segwit"); UniValue vbavailable(UniValue::VOBJ); for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) { Consensus::DeploymentPos pos = Consensus::DeploymentPos(j); diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py index 909a43c8d9..6de9296927 100755 --- a/test/functional/feature_segwit.py +++ b/test/functional/feature_segwit.py @@ -108,12 +108,7 @@ class SegWitTest(BitcoinTestFramework): assert tmpl['sigoplimit'] == 20000 assert tmpl['transactions'][0]['hash'] == txid assert tmpl['transactions'][0]['sigops'] == 2 - tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']}) - assert tmpl['sizelimit'] == 1000000 - assert 'weightlimit' not in tmpl - assert tmpl['sigoplimit'] == 20000 - assert tmpl['transactions'][0]['hash'] == txid - assert tmpl['transactions'][0]['sigops'] == 2 + assert '!segwit' not in tmpl['rules'] self.nodes[0].generate(1) # block 162 balance_presetup = self.nodes[0].getbalance() @@ -213,6 +208,7 @@ class SegWitTest(BitcoinTestFramework): assert tmpl['sigoplimit'] == 80000 assert tmpl['transactions'][0]['txid'] == txid assert tmpl['transactions'][0]['sigops'] == 8 + assert '!segwit' in tmpl['rules'] self.nodes[0].generate(1) # Mine a block to clear the gbt cache |