From 2abe8cc3b760219cfa434e4c96e9f8d3611d0037 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 17 Jan 2020 05:27:12 +0000 Subject: [PATCH 1/2] Bugfix: Include "csv","!segwit" in "rules" They have been missing since buried deployments were merged --- src/rpc/mining.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 13bf611d32..cec01c0738 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -576,6 +576,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); From 412d5fe8791c417bf46fc55a5bb8d59be98a33db Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 17 Jan 2020 05:27:56 +0000 Subject: [PATCH 2/2] QA: feature_segwit: Check that template "rules" includes "!segwit" as appropriate --- test/functional/feature_segwit.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py index d47065d1cb..d5da7ee62a 100755 --- a/test/functional/feature_segwit.py +++ b/test/functional/feature_segwit.py @@ -107,12 +107,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() @@ -212,6 +207,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