aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-20 17:31:52 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-20 17:32:02 +0100
commitaa791e29114f200739f0ec654b753861549e529c (patch)
tree431bc6a1e04a4ad95be6d96f05d1230993578ae1 /qa
parent2dad02232af1456fb298f17cdbc3f8eea96f1a7c (diff)
parent279f944e8d3b437d31210f3ba3e798e98a9334fc (diff)
downloadbitcoin-aa791e29114f200739f0ec654b753861549e529c.tar.xz
Merge #9619: Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
279f944 QA: Test GBT size/weight limit values (Luke Dashjr) 9fc7f0b Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates (Luke Dashjr)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/segwit.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/qa/rpc-tests/segwit.py b/qa/rpc-tests/segwit.py
index 299f5387e7..d6831e00e3 100755
--- a/qa/rpc-tests/segwit.py
+++ b/qa/rpc-tests/segwit.py
@@ -130,10 +130,14 @@ class SegWitTest(BitcoinTestFramework):
print("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({})
+ 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)
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)
@@ -241,6 +245,8 @@ class SegWitTest(BitcoinTestFramework):
print("Verify sigops are counted in GBT with BIP141 rules after the fork")
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
tmpl = self.nodes[0].getblocktemplate({'rules':['segwit']})
+ assert(tmpl['sizelimit'] >= 3999577) # actual maximum size is lower due to minimum mandatory non-witness data
+ assert(tmpl['weightlimit'] == 4000000)
assert(tmpl['sigoplimit'] == 80000)
assert(tmpl['transactions'][0]['txid'] == txid)
assert(tmpl['transactions'][0]['sigops'] == 8)
@@ -250,6 +256,8 @@ class SegWitTest(BitcoinTestFramework):
try:
tmpl = self.nodes[0].getblocktemplate({})
assert(len(tmpl['transactions']) == 1) # Doesn't include witness tx
+ 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)