1
0

Merge pull request #9636 from SomberNight/202503_avoid_reuse

wallet: add new config option "FREEZE_REUSED_ADDRESS_UTXOS"
This commit is contained in:
ThomasV
2025-03-14 12:56:29 +01:00
committed by GitHub
4 changed files with 25 additions and 0 deletions

View File

@@ -976,8 +976,14 @@ class AddressSynchronizer(Logger, EventListener):
return coins
def is_used(self, address: str) -> bool:
"""Whether any tx ever touched `address`."""
return self.get_address_history_len(address) != 0
def is_used_as_from_address(self, address: str) -> bool:
"""Whether any tx ever spent from `address`."""
received, sent = self.get_addr_io(address)
return len(sent) > 0
def is_empty(self, address: str) -> bool:
coins = self.get_addr_utxo(address)
return not bool(coins)