Skip to content

Commit b207971

Browse files
committed
Fix feature_segwit failure due to witness
1 parent 3c776fd commit b207971

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/functional/feature_segwit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,14 @@ def run_test(self):
236236

237237
self.log.info("Verify sigops are counted in GBT with BIP141 rules after the fork")
238238
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
239+
raw_tx = self.nodes[0].getrawtransaction(txid, True)
239240
tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
240241
assert_greater_than_or_equal(tmpl['sizelimit'], 3999577) # actual maximum size is lower due to minimum mandatory non-witness data
241242
assert_equal(tmpl['weightlimit'], 4000000)
242243
assert_equal(tmpl['sigoplimit'], 80000)
243244
assert_equal(tmpl['transactions'][0]['txid'], txid)
244-
assert_equal(tmpl['transactions'][0]['sigops'], 8)
245+
expected_sigops = 9 if 'txinwitness' in raw_tx["vin"][0] else 8
246+
assert_equal(tmpl['transactions'][0]['sigops'], expected_sigops)
245247
assert '!segwit' in tmpl['rules']
246248

247249
self.generate(self.nodes[0], 1) # Mine a block to clear the gbt cache

0 commit comments

Comments
 (0)