aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mining_getblocktemplate_longpoll.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2018-11-26 11:17:38 -0500
committerJohn Newbery <john@johnnewbery.com>2018-12-10 16:42:14 -0500
commit0025c9eae41654c204ecf31f7e134b91dc473a75 (patch)
tree4f02f77f87d09301d777b64287203849f0fe18cc /test/functional/mining_getblocktemplate_longpoll.py
parent5f23460c7e316fe7c944680f3feff07ebb867f70 (diff)
downloadbitcoin-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/mining_getblocktemplate_longpoll.py')
-rwxr-xr-xtest/functional/mining_getblocktemplate_longpoll.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/mining_getblocktemplate_longpoll.py b/test/functional/mining_getblocktemplate_longpoll.py
index 9a3c15a4a7..72cde8e811 100755
--- a/test/functional/mining_getblocktemplate_longpoll.py
+++ b/test/functional/mining_getblocktemplate_longpoll.py
@@ -15,14 +15,14 @@ class LongpollThread(threading.Thread):
def __init__(self, node):
threading.Thread.__init__(self)
# query current longpollid
- template = node.getblocktemplate()
+ template = node.getblocktemplate({'rules': ['segwit']})
self.longpollid = template['longpollid']
# create a new connection to the node, we can't use the same
# connection from two threads
self.node = get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir)
def run(self):
- self.node.getblocktemplate({'longpollid':self.longpollid})
+ self.node.getblocktemplate({'longpollid': self.longpollid, 'rules': ['segwit']})
class GetBlockTemplateLPTest(BitcoinTestFramework):
def set_test_params(self):
@@ -34,10 +34,10 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
def run_test(self):
self.log.info("Warning: this test will take about 70 seconds in the best case. Be patient.")
self.nodes[0].generate(10)
- template = self.nodes[0].getblocktemplate()
+ template = self.nodes[0].getblocktemplate({'rules': ['segwit']})
longpollid = template['longpollid']
# longpollid should not change between successive invocations if nothing else happens
- template2 = self.nodes[0].getblocktemplate()
+ template2 = self.nodes[0].getblocktemplate({'rules': ['segwit']})
assert(template2['longpollid'] == longpollid)
# Test 1: test that the longpolling wait if we do nothing