Merge bitcoin/bitcoin#35968: test: sync funding block before isolating nodes

8454fb2bd7 test: sync funding block before isolating nodes (shaurya2k06)

Pull request description:

  Fixes #35967

  test_alternate_witness_tx mines the taproot funding output on node0 with
  sync_fun=self.no_op and immediately disconnects. node1 later includes the
  script-path spend via generateblock. If the funding block has not reached
  node1, that call fails with bad-txns-inputs-missingorspent.

  Drop the no_op so generate() uses the default sync_all before the partition.
  Later generate* calls keep no_op because the nodes are then disconnected.

  Seen twice this week in hebasto bitcoin-core-nightly NetBSD jobs:
  https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31350308484/job/93339698854
  https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31765546925/job/94660585799

  The modified test is test/functional/wallet_listtransactions.py. I ran it
  locally three times with build/test/functional/wallet_listtransactions.py.

ACKs for top commit:
  achow101:
    ACK 8454fb2bd7
  furszy:
    utACK 8454fb2bd7

Tree-SHA512: 6b8fdcdc9ce9c57c2939caff34850e88450864c909fe226ba9b6e02ffcefa3625623589b8ecd2f09b9ca16bcaec3a64bd07642ff2c47ae6e8d250de478d34b53
This commit is contained in:
merge-script
2026-08-19 15:02:58 +01:00

View File

@@ -283,7 +283,7 @@ class ListTransactionsTest(BitcoinTestFramework):
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)