1
0

Merge pull request #10414 from SomberNight/202601_wallet_stored_height_fix

addr_sync: update "stored_height" db field immediately on wallet-open
This commit is contained in:
ThomasV
2026-01-16 09:47:39 +01:00
committed by GitHub

View File

@@ -208,12 +208,13 @@ class AddressSynchronizer(Logger, EventListener):
self.verifier = SPV(self.network, self)
self.asyncio_loop = network.asyncio_loop
self.register_callbacks()
self._update_stored_local_height()
@event_listener
@with_lock
def on_event_blockchain_updated(self, *args):
self.invalidate_cache()
self.db.put('stored_height', self.get_local_height())
self._update_stored_local_height()
async def stop(self):
if self.network:
@@ -694,6 +695,9 @@ class AddressSynchronizer(Logger, EventListener):
return cached_local_height
return self.network.get_local_height() if self.network else self.db.get('stored_height', 0)
def _update_stored_local_height(self) -> None:
self.db.put('stored_height', self.get_local_height())
def set_future_tx(self, txid: str, *, wanted_height: int):
"""Mark a local tx as "future" (encumbered by a timelock).
wanted_height is the min (abs) block height at which the tx can get into the mempool (be broadcast).