Merge bitcoin/bitcoin#35968: test: sync funding block before isolating nodes
What changed, and why it matters
This is a one-line fix inside a Bitcoin Core automated test. The test was occasionally failing because it mined a block on one node and immediately disconnected the nodes before that block had time to reach the others. The fix simply lets the test framework synchronize the newly mined block across nodes before disconnecting them. It does not change any production wallet, consensus, or networking code, so it has no direct security impact on real users.
No security action required. Treat as a normal test reliability improvement.
Security signals we found
No production code changed
No consensus, P2P, wallet, or cryptography logic modified
Change is confined to a single functional test file
Fix addresses a race condition / test flakiness, not a vulnerability
Evidence from the diff
In test/functional/wallet_listtransactions.py, the test_alternate_witness_tx test imports a taproot descriptor, funds a bech32m address, mines the funding block on node0, then immediately disconnects node0 from the rest of the network. The original code called self.generate(self.nodes[0], 1, sync_fun=self.no_op), which skipped the default sync_all step. If the funding block had not yet propagated to node1, a later generateblock call on node1 to include the script-path spend would fail with bad-txns-inputs-missingorspent. The patch removes sync_fun=self.no_op so the default synchronization runs before the partition. Subsequent generate* calls keep no_op because the nodes are already disconnected. This is purely a test-flakiness fix.
Changed components
test/functional/wallet_listtransactions.pyInspect captured patch +1 / −1
### test/functional/wallet_listtransactions.py
@@ -283,7 +283,7 @@ def test_alternate_witness_tx(self):
desc = descsum_create(f"tr({xpubs[0].to_string()}/*,pk({xprvs[1].to_string()}/*))")
assert_equal(wallet.importdescriptors([{"desc": desc, "active": True, "timestamp": "now"}])[0]["success"], True)
default_wallet.sendtoaddress(wallet.getnewaddress(address_type="bech32m"), 1)
- self.generate(self.nodes[0], 1, sync_fun=self.no_op)
+ self.generate(self.nodes[0], 1)
# Isolate node0 for later reorg coverage
self.disconnect_nodes(0, 1)
self.disconnect_nodes(0, 2)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.