|
@ -973,17 +973,20 @@ class Abstract_Wallet(AddressSynchronizer): |
|
|
def can_export(self): |
|
|
def can_export(self): |
|
|
return not self.is_watching_only() and hasattr(self.keystore, 'get_private_key') |
|
|
return not self.is_watching_only() and hasattr(self.keystore, 'get_private_key') |
|
|
|
|
|
|
|
|
def address_is_old(self, address, age_limit=2): |
|
|
def address_is_old(self, address: str, *, req_conf: int = 3) -> bool: |
|
|
age = -1 |
|
|
"""Returns whether address has any history that is deeply confirmed. |
|
|
|
|
|
|
|
|
|
|
|
Note: this is NOT verified using SPV. (TODO should it be?) |
|
|
|
|
|
""" |
|
|
|
|
|
max_conf = -1 |
|
|
h = self.db.get_addr_history(address) |
|
|
h = self.db.get_addr_history(address) |
|
|
for tx_hash, tx_height in h: |
|
|
for tx_hash, tx_height in h: |
|
|
if tx_height <= 0: |
|
|
if tx_height <= 0: |
|
|
tx_age = 0 |
|
|
tx_age = 0 |
|
|
else: |
|
|
else: |
|
|
tx_age = self.get_local_height() - tx_height + 1 |
|
|
tx_age = self.get_local_height() - tx_height + 1 |
|
|
if tx_age > age: |
|
|
max_conf = max(max_conf, tx_age) |
|
|
age = tx_age |
|
|
return max_conf >= req_conf |
|
|
return age > age_limit |
|
|
|
|
|
|
|
|
|
|
|
def bump_fee(self, *, tx, new_fee_rate, config) -> Transaction: |
|
|
def bump_fee(self, *, tx, new_fee_rate, config) -> Transaction: |
|
|
"""Increase the miner fee of 'tx'. |
|
|
"""Increase the miner fee of 'tx'. |
|
@ -1889,6 +1892,7 @@ class Deterministic_Wallet(Abstract_Wallet): |
|
|
else: |
|
|
else: |
|
|
break |
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
@AddressSynchronizer.with_local_height_cached |
|
|
def synchronize(self): |
|
|
def synchronize(self): |
|
|
with self.lock: |
|
|
with self.lock: |
|
|
self.synchronize_sequence(False) |
|
|
self.synchronize_sequence(False) |
|
|