mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
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.
This commit is contained in:
parent
2305643646
commit
8aab5157c5
1 changed files with 1 additions and 0 deletions
|
@ -92,6 +92,7 @@ class CreateTxWalletTest(BitcoinTestFramework):
|
|||
txid = tx_data['txid']
|
||||
vout = 1
|
||||
|
||||
self.nodes[0].syncwithvalidationinterfacequeue()
|
||||
options = {"change_position": 0, "add_inputs": False}
|
||||
for i in range(1, 25):
|
||||
options['inputs'] = [{'txid': txid, 'vout': vout}]
|
||||
|
|
Loading…
Add table
Reference in a new issue