Skip to content

Commit 8aab515

Browse files
committed
test: wallet_create_tx.py fix race
Because wallets are internally synchronized through the validation interface, and the interface dispatches events on a worker thread, it is possible for a transaction created by the first wallet to not arrive at the second wallet before the second wallet attempts to use one of its outputs. This is because we do not wait for the BroadcastTransaction callback during the wallet's "submit to mempool" process. To address this in the tests, we need to sync the validation queue.
1 parent 2305643 commit 8aab515

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/functional/wallet_create_tx.py

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def test_create_too_long_mempool_chain(self):
9292
txid = tx_data['txid']
9393
vout = 1
9494

95+
self.nodes[0].syncwithvalidationinterfacequeue()
9596
options = {"change_position": 0, "add_inputs": False}
9697
for i in range(1, 25):
9798
options['inputs'] = [{'txid': txid, 'vout': vout}]

0 commit comments

Comments
 (0)