Skip to content

Commit d648bbb

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#23124: Fix feature_segwit.py failure due to witness
b207971 Fix feature_segwit failure due to witness (Samuel Dobson) Pull request description: Fixes #23116 The failure is due to sometimes spending segwit outputs, which add an additional 1 sigop in the witness, added to the 2 (*4) in the outputs. ACKs for top commit: brunoerg: tACK b207971 Tree-SHA512: 7e3c09d162e6941a3028514e95ae3aab2a3f858e2f056229c5faff5e37ece897dc63e3f8c0e07fad9fc4621b74a6dee5ff777e910b2b009a41bb6e72a09217bd
2 parents ba1a82e + b207971 commit d648bbb

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)