Skip to content

Commit e7ad86e

Browse files
committed
test: fix another intermittent failure in wallet_basic.py
During init, the test framework will start using rpc after the mempool was loaded. It will not wait for postInitProcess or outstanding transactionAddedToMempool notifications, leading to a possible race, in which listunspent is being called while the tx is still in Inactive status. Prevent this by processing outstanding notifications.
1 parent 07350e2 commit e7ad86e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/wallet_basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ def run_test(self):
656656

657657
# check that it works again with -spendzeroconfchange set (=default)
658658
self.restart_node(0, ["-spendzeroconfchange=1"])
659+
# Make sure the wallet knows the tx in the mempool
660+
self.nodes[0].syncwithvalidationinterfacequeue()
661+
659662
zeroconf_wallet = self.nodes[0].get_wallet_rpc("zeroconf")
660663
utxos = zeroconf_wallet.listunspent(minconf=0)
661664
assert_equal(len(utxos), 1)

0 commit comments

Comments
 (0)