aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mempool_spend_coinbase.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-09-17 15:38:38 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-20 08:31:04 +0200
commitfa7e3f1fc114056967963a4ad4863a56e406c57e (patch)
tree521abe1118ad3a0e2d7dea65265406c017c57d0d /test/functional/mempool_spend_coinbase.py
parent226731ac1144886d693d3508b331f98727ab883c (diff)
downloadbitcoin-fa7e3f1fc114056967963a4ad4863a56e406c57e.tar.xz
test: Replace MiniWallet scan_blocks with rescan_utxos
Diffstat (limited to 'test/functional/mempool_spend_coinbase.py')
-rwxr-xr-xtest/functional/mempool_spend_coinbase.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/mempool_spend_coinbase.py b/test/functional/mempool_spend_coinbase.py
index e97595ed86..4e1dd80ba7 100755
--- a/test/functional/mempool_spend_coinbase.py
+++ b/test/functional/mempool_spend_coinbase.py
@@ -28,14 +28,14 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
chain_height = 198
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(chain_height + 1))
assert_equal(chain_height, self.nodes[0].getblockcount())
+ wallet.rescan_utxos()
# Coinbase at height chain_height-100+1 ok in mempool, should
# get mined. Coinbase at height chain_height-100+2 is
# too immature to spend.
- wallet.scan_blocks(start=chain_height - 100 + 1, num=1)
- utxo_mature = wallet.get_utxo()
- wallet.scan_blocks(start=chain_height - 100 + 2, num=1)
- utxo_immature = wallet.get_utxo()
+ coinbase_txid = lambda h: self.nodes[0].getblock(self.nodes[0].getblockhash(h))['tx'][0]
+ utxo_mature = wallet.get_utxo(txid=coinbase_txid(chain_height - 100 + 1))
+ utxo_immature = wallet.get_utxo(txid=coinbase_txid(chain_height - 100 + 2))
spend_mature_id = wallet.send_self_transfer(from_node=self.nodes[0], utxo_to_spend=utxo_mature)["txid"]