wallet: (trivial) refactor is_frozen_coin
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user