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:
furszy 2023-03-23 16:37:06 -03:00
parent 2305643646
commit 8aab5157c5
No known key found for this signature in database
GPG Key ID: 5DD23CCC686AA623

View File

@ -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}]