From ade6adb7dc0782b18d193b738590641c3d237d79 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Thu, 29 Jul 2021 20:59:32 -0700 Subject: [PATCH] [lbry] Minor tweaks to log messages --- blockchain/chain.go | 10 ++++++---- server.go | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/blockchain/chain.go b/blockchain/chain.go index a9b58cf1..128101f8 100644 --- a/blockchain/chain.go +++ b/blockchain/chain.go @@ -1845,7 +1845,8 @@ func rebuildMissingClaimTrieData(b *BlockChain, done <-chan struct{}) error { return b.claimTrie.ResetHeight(target) } - start := time.Now().Add(-6 * time.Second) + start := time.Now() + lastReport := time.Now() // TODO: move this view inside the loop (or recreate it every 5 sec.) // as accumulating all inputs has potential to use a huge amount of RAM // but we need to get the spent inputs working for that to be possible @@ -1885,11 +1886,12 @@ func rebuildMissingClaimTrieData(b *BlockChain, done <-chan struct{}) error { return err } } - if time.Since(start).Seconds() > 5.0 { - start = time.Now() + if time.Since(lastReport) > time.Second*5 { + lastReport = time.Now() log.Infof("Rebuilding claim trie data to %d. At: %d", target, h) } } - log.Infof("Completed rebuilding claim trie data to %d", b.claimTrie.Height()) + log.Infof("Completed rebuilding claim trie data to %d. Took %s ", + b.claimTrie.Height(), time.Since(start)) return nil } diff --git a/server.go b/server.go index 055734cf..482fd892 100644 --- a/server.go +++ b/server.go @@ -2752,12 +2752,12 @@ func newServer(listenAddrs, agentBlacklist, agentWhitelist []string, return nil, err } if h := cfg.ClaimTrieHeight; h != 0 { - lbryLog.Infof("Reseting height to %d", h) + lbryLog.Infof("Reseting claim trie height to %d", h) err := ct.ResetHeight(int32(h)) if err != nil { return nil, err } - lbryLog.Infof("Height is reset to %d", h) + lbryLog.Infof("Claim trie height is reset to %d", h) } }