From 330db61b36ef4379bc72b449579d481239439c06 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 12 Oct 2018 18:11:47 -0300 Subject: [PATCH] report balance and summary on startup --- lbrynet/wallet/ledger.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lbrynet/wallet/ledger.py b/lbrynet/wallet/ledger.py index 66a2bad36..2d08f9ea4 100644 --- a/lbrynet/wallet/ledger.py +++ b/lbrynet/wallet/ledger.py @@ -84,6 +84,19 @@ class MainNetLedger(BaseLedger): a.maybe_migrate_certificates() for a in self.accounts ]) yield defer.DeferredList([a.save_max_gap() for a in self.accounts]) + yield self._report_state() + + @defer.inlineCallbacks + def _report_state(self): + for account in self.accounts: + total_receiving = len((yield account.receiving.get_addresses())) + total_change = len((yield account.change.get_addresses())) + channel_count = yield account.get_channel_count() + claim_count = yield account.get_claim_count() + log.info("Loaded account %s with %d receiving addresses (gap: %d), " + "%d change addresses (gap: %d), %d channels, %d certificates and %d claims.", + account.id, total_receiving, account.receiving.gap, total_change, account.change.gap, + channel_count, len(account.certificates), claim_count) class TestNetLedger(MainNetLedger):