diff options
author | John Newbery <john@johnnewbery.com> | 2022-05-16 18:50:59 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2022-05-18 13:47:54 +0100 |
commit | bf6526f4a0ab30f77952ecdee90cd77dd9ba06f6 (patch) | |
tree | 1ecd248df626ffbea56d1ae8ffb730d60372744c /test/functional/p2p_compactblocks.py | |
parent | c65bf50b44a38bc55224d8967e0df7af60ea4f1b (diff) | |
download | bitcoin-bf6526f4a0ab30f77952ecdee90cd77dd9ba06f6.tar.xz |
[test] Remove segwit argument from build_block_on_tip()
The only place that segwit=True is for a block that contains only the
coinbase transaction. Since the witness commitment is optional if none
of the transactions have a witness, we can leave it out. This doesn't
change the test coverage, which is testing p2p compact block logic.
Suggested in https://github.com/bitcoin/bitcoin/pull/20799#discussion_r867782119
Diffstat (limited to 'test/functional/p2p_compactblocks.py')
-rwxr-xr-x | test/functional/p2p_compactblocks.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/p2p_compactblocks.py b/test/functional/p2p_compactblocks.py index 8eec8dbc0d..b9ac3c32c5 100755 --- a/test/functional/p2p_compactblocks.py +++ b/test/functional/p2p_compactblocks.py @@ -146,10 +146,8 @@ class CompactBlocksTest(BitcoinTestFramework): ]] self.utxos = [] - def build_block_on_tip(self, node, segwit=False): + def build_block_on_tip(self, node): block = create_block(tmpl=node.getblocktemplate(NORMAL_GBT_REQUEST_PARAMS)) - if segwit: - add_witness_commitment(block) block.solve() return block @@ -381,7 +379,7 @@ class CompactBlocksTest(BitcoinTestFramework): # Try announcing a block with an inv or header, expect a compactblock # request for announce in ["inv", "header"]: - block = self.build_block_on_tip(node, segwit=True) + block = self.build_block_on_tip(node) if announce == "inv": test_node.send_message(msg_inv([CInv(MSG_BLOCK, block.sha256)])) |