Skip to content

Commit 2ad3b5d

Browse files
committed
tests: wallet_basic lock needed unspents
To avoid accidentally spending UTXOs that are needed later in the test, lock those UTXOs after they're creation.
1 parent b77885f commit 2ad3b5d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/wallet_basic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
assert_equal,
1414
assert_fee_amount,
1515
assert_raises_rpc_error,
16+
find_vout_for_address,
1617
)
1718
from test_framework.wallet_util import test_address
1819

@@ -427,6 +428,9 @@ def run_test(self):
427428
# 1. Send some coins to generate new UTXO
428429
address_to_import = self.nodes[2].getnewaddress()
429430
txid = self.nodes[0].sendtoaddress(address_to_import, 1)
431+
self.sync_mempools(self.nodes[0:3])
432+
vout = find_vout_for_address(self.nodes[2], txid, address_to_import)
433+
self.nodes[2].lockunspent(False, [{"txid": txid, "vout": vout}])
430434
self.generate(self.nodes[0], 1)
431435
self.sync_all(self.nodes[0:3])
432436

0 commit comments

Comments
 (0)