diff options
author | John Newbery <john@johnnewbery.com> | 2018-11-26 11:17:38 -0500 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-12-10 16:42:14 -0500 |
commit | 0025c9eae41654c204ecf31f7e134b91dc473a75 (patch) | |
tree | 4f02f77f87d09301d777b64287203849f0fe18cc /test/functional/feature_segwit.py | |
parent | 5f23460c7e316fe7c944680f3feff07ebb867f70 (diff) | |
download | bitcoin-0025c9eae41654c204ecf31f7e134b91dc473a75.tar.xz |
[mining] segwit option must be set in GBT
Calling getblocktemplate without the segwit rule specified is most
likely a client error, since it results in lower fees for the miner.
Prevent this client error by failing getblocktemplate if called without
the segwit rule specified.
Diffstat (limited to 'test/functional/feature_segwit.py')
-rwxr-xr-x | test/functional/feature_segwit.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py index 7098a03f1e..4bcdf9af55 100755 --- a/test/functional/feature_segwit.py +++ b/test/functional/feature_segwit.py @@ -90,7 +90,7 @@ class SegWitTest(BitcoinTestFramework): self.log.info("Verify sigops are counted in GBT with pre-BIP141 rules before the fork") txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1) - tmpl = self.nodes[0].getblocktemplate({}) + tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']}) assert(tmpl['sizelimit'] == 1000000) assert('weightlimit' not in tmpl) assert(tmpl['sigoplimit'] == 20000) @@ -232,15 +232,7 @@ class SegWitTest(BitcoinTestFramework): assert(tx.wit.is_null()) assert(txid3 in self.nodes[0].getrawmempool()) - # Now try calling getblocktemplate() without segwit support. - template = self.nodes[0].getblocktemplate() - - # Check that tx1 is the only transaction of the 3 in the template. - template_txids = [t['txid'] for t in template['transactions']] - assert(txid2 not in template_txids and txid3 not in template_txids) - assert(txid1 in template_txids) - - # Check that running with segwit support results in all 3 being included. + # Check that getblocktemplate includes all transactions. template = self.nodes[0].getblocktemplate({"rules": ["segwit"]}) template_txids = [t['txid'] for t in template['transactions']] assert(txid1 in template_txids) |