Skip to content

Commit

Permalink
Merge bitcoin#27318: test: wallet_create_tx.py fix race
Browse files Browse the repository at this point in the history
8aab515 test: wallet_create_tx.py fix race (furszy)

Pull request description:

  Fixes bitcoin#27316

  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 to 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
  manually sync the validation queue.

ACKs for top commit:
  josibake:
    ACK bitcoin@8aab515
  theStack:
    ACK 8aab515

Tree-SHA512: 76364370ab292a5c3ea1ed61cd353fc626a9e9cd6ce18464c24da1b3dcb34b65006e2bc42b84bbd25af03f9449231990bf789504728972db3217b569099eb309
  • Loading branch information
fanquake committed Mar 28, 2023
2 parents 2200086 + 8aab515 commit 6882828
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/wallet_create_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def test_create_too_long_mempool_chain(self):
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}]
Expand Down

0 comments on commit 6882828

Please sign in to comment.