1
0

wallet: (trivial) refactor is_frozen_coin

This commit is contained in:
SomberNight
2025-03-14 00:07:26 +00:00
parent 80d0d5fddd
commit 3ff794da12

View File

@@ -1963,9 +1963,12 @@ class Abstract_Wallet(ABC, Logger, EventListener):
# note: there are three possible states for 'frozen': # note: there are three possible states for 'frozen':
# True/False if the user explicitly set it, # True/False if the user explicitly set it,
# None otherwise # None otherwise
if frozen is None: if frozen is not None: # user has explicitly set the state
return self._is_coin_small_and_unconfirmed(utxo) return bool(frozen)
return bool(frozen) # State not set. We implicitly mark certain coins as frozen:
if self._is_coin_small_and_unconfirmed(utxo):
return True
return False
def _is_coin_small_and_unconfirmed(self, utxo: PartialTxInput) -> bool: def _is_coin_small_and_unconfirmed(self, utxo: PartialTxInput) -> bool:
"""If true, the coin should not be spent. """If true, the coin should not be spent.