What changed, and why it matters
This commit only changes a single test file. It replaces a test setup that generated 101 fresh blocks with one that uses blocks already created by the test framework. There is no change to Bitcoin Core's actual network, wallet, or consensus code, so it cannot affect real users or funds.
No security action needed. Review as a normal test-quality change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/mempool_accept_wtxid.py. It removes self.setup_clean_chain = True and the self.generate(node, 101) call, instead fetching the block hash at height 1 from the pre-generated chain supplied by the test framework. The rest of the test logic is unchanged. This is a test-only refactor to speed up or standardize the test setup.
Changed components
test/functional/mempool_accept_wtxid.pyInspect captured patch +2 / −6
diff --git a/test/functional/mempool_accept_wtxid.py b/test/functional/mempool_accept_wtxid.py
index 60fa580f..fe46fbf7 100755
--- a/test/functional/mempool_accept_wtxid.py
+++ b/test/functional/mempool_accept_wtxid.py
@@ -22,14 +22,11 @@ from test_framework.util import (
class MempoolWtxidTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
- self.setup_clean_chain = True
def run_test(self):
node = self.nodes[0]
-
- self.log.info('Start with empty mempool and 101 blocks')
- # The last 100 coinbase transactions are premature
- blockhash = self.generate(node, 101)[0]
+ self.log.info('Start with pre-generated blocks')
+ blockhash = self.nodes[0].getblockhash(1)
txid = node.getblock(blockhash=blockhash, verbosity=2)["tx"][0]["txid"]
assert_equal(node.getmempoolinfo()['size'], 0)
@@ -56,7 +53,6 @@ class MempoolWtxidTest(BitcoinTestFramework):
self.log.info("Submit child_one to the mempool")
txid_submitted = node.sendrawtransaction(child_one.serialize().hex())
assert_equal(node.getmempoolentry(txid_submitted)['wtxid'], child_one_wtxid)
-
peer_wtxid_relay.wait_for_broadcast([child_one_wtxid])
assert_equal(node.getmempoolinfo()["unbroadcastcount"], 0)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.