@@ -130,10 +130,14 @@ def run_test(self):
130
130
print ("Verify sigops are counted in GBT with pre-BIP141 rules before the fork" )
131
131
txid = self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1 )
132
132
tmpl = self .nodes [0 ].getblocktemplate ({})
133
+ assert (tmpl ['sizelimit' ] == 1000000 )
134
+ assert ('weightlimit' not in tmpl )
133
135
assert (tmpl ['sigoplimit' ] == 20000 )
134
136
assert (tmpl ['transactions' ][0 ]['hash' ] == txid )
135
137
assert (tmpl ['transactions' ][0 ]['sigops' ] == 2 )
136
138
tmpl = self .nodes [0 ].getblocktemplate ({'rules' :['segwit' ]})
139
+ assert (tmpl ['sizelimit' ] == 1000000 )
140
+ assert ('weightlimit' not in tmpl )
137
141
assert (tmpl ['sigoplimit' ] == 20000 )
138
142
assert (tmpl ['transactions' ][0 ]['hash' ] == txid )
139
143
assert (tmpl ['transactions' ][0 ]['sigops' ] == 2 )
@@ -241,6 +245,8 @@ def run_test(self):
241
245
print ("Verify sigops are counted in GBT with BIP141 rules after the fork" )
242
246
txid = self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1 )
243
247
tmpl = self .nodes [0 ].getblocktemplate ({'rules' :['segwit' ]})
248
+ assert (tmpl ['sizelimit' ] >= 3999577 ) # actual maximum size is lower due to minimum mandatory non-witness data
249
+ assert (tmpl ['weightlimit' ] == 4000000 )
244
250
assert (tmpl ['sigoplimit' ] == 80000 )
245
251
assert (tmpl ['transactions' ][0 ]['txid' ] == txid )
246
252
assert (tmpl ['transactions' ][0 ]['sigops' ] == 8 )
@@ -250,6 +256,8 @@ def run_test(self):
250
256
try :
251
257
tmpl = self .nodes [0 ].getblocktemplate ({})
252
258
assert (len (tmpl ['transactions' ]) == 1 ) # Doesn't include witness tx
259
+ assert (tmpl ['sizelimit' ] == 1000000 )
260
+ assert ('weightlimit' not in tmpl )
253
261
assert (tmpl ['sigoplimit' ] == 20000 )
254
262
assert (tmpl ['transactions' ][0 ]['hash' ] == txid )
255
263
assert (tmpl ['transactions' ][0 ]['sigops' ] == 2 )
0 commit comments