diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-09-29 13:36:16 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-09-29 13:36:19 +0200 |
commit | d648bbb0a7909aed953b6f7907690134606a033a (patch) | |
tree | 1e5f92959fbf4b4e4b24d23043e1a7c09a56cc61 /test/functional/feature_segwit.py | |
parent | ba1a82e6083f99cb0ab17235926b762179b4df25 (diff) | |
parent | b207971465f5c0dd2b1b663dcb8b74e0ac59b301 (diff) | |
download | bitcoin-d648bbb0a7909aed953b6f7907690134606a033a.tar.xz |
Merge bitcoin/bitcoin#23124: Fix feature_segwit.py failure due to witness
b207971465f5c0dd2b1b663dcb8b74e0ac59b301 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 b207971465f5c0dd2b1b663dcb8b74e0ac59b301
Tree-SHA512: 7e3c09d162e6941a3028514e95ae3aab2a3f858e2f056229c5faff5e37ece897dc63e3f8c0e07fad9fc4621b74a6dee5ff777e910b2b009a41bb6e72a09217bd
Diffstat (limited to 'test/functional/feature_segwit.py')
-rwxr-xr-x | test/functional/feature_segwit.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py index 4054a9a903..25d1cb2bf1 100755 --- a/test/functional/feature_segwit.py +++ b/test/functional/feature_segwit.py @@ -236,12 +236,14 @@ class SegWitTest(BitcoinTestFramework): self.log.info("Verify sigops are counted in GBT with BIP141 rules after the fork") txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1) + raw_tx = self.nodes[0].getrawtransaction(txid, True) tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']}) assert_greater_than_or_equal(tmpl['sizelimit'], 3999577) # actual maximum size is lower due to minimum mandatory non-witness data assert_equal(tmpl['weightlimit'], 4000000) assert_equal(tmpl['sigoplimit'], 80000) assert_equal(tmpl['transactions'][0]['txid'], txid) - assert_equal(tmpl['transactions'][0]['sigops'], 8) + expected_sigops = 9 if 'txinwitness' in raw_tx["vin"][0] else 8 + assert_equal(tmpl['transactions'][0]['sigops'], expected_sigops) assert '!segwit' in tmpl['rules'] self.generate(self.nodes[0], 1) # Mine a block to clear the gbt cache |