From 22b2cf8b0ce979cee342c979014b295787fbfc7e Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 23 Aug 2019 02:07:42 -0300 Subject: [PATCH] warn when out of sync --- torba/torba/client/baseledger.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/torba/torba/client/baseledger.py b/torba/torba/client/baseledger.py index d915b1308..72db7b802 100644 --- a/torba/torba/client/baseledger.py +++ b/torba/torba/client/baseledger.py @@ -469,6 +469,15 @@ class BaseLedger(metaclass=LedgerRegistry): if address_manager is not None: await address_manager.ensure_address_gap() + local_status, local_history = await self.get_local_status_and_history(address) + + if local_status != remote_status: + log.warning( + "Wallet is out of sync after syncing. Remote: %s with %d items, local: %s with %d items", + remote_status, len(remote_history), local_status, len(local_history) + ) + else: + log.info("Sync completed for: %s", address) async def cache_transaction(self, txid, remote_height): cache_item = self._tx_cache.get(txid)