diff options
author | brunoerg <brunoely.gc@gmail.com> | 2023-05-18 11:17:36 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2023-05-19 09:13:30 -0300 |
commit | 272eb5561667482f8226bcf98eea00689dccefb8 (patch) | |
tree | 4153fbae94fc80c1df3ec220293ddb64d8b869f0 /test/functional/test_framework | |
parent | a951c34f179dad0c7059b04a7f1e6b0804462168 (diff) |
test: fix `include_immature_coinbase` logic in `get_utxos`
Use current block height to compute the confirmation count
instead of using the value from utxo object
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r-- | test/functional/test_framework/wallet.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index 90f7275b44..1d546e12bd 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -235,7 +235,8 @@ class MiniWallet: def get_utxos(self, *, include_immature_coinbase=False, mark_as_spent=True): """Returns the list of all utxos and optionally mark them as spent""" if not include_immature_coinbase: - utxo_filter = filter(lambda utxo: not utxo['coinbase'] or COINBASE_MATURITY <= utxo['confirmations'], self._utxos) + blocks_height = self._test_node.getblockchaininfo()['blocks'] + utxo_filter = filter(lambda utxo: not utxo['coinbase'] or COINBASE_MATURITY - 1 <= blocks_height - utxo['height'], self._utxos) else: utxo_filter = self._utxos utxos = deepcopy(list(utxo_filter)) |