From 6d16463627de23b3fa61af66a1e5b952451fc75b Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 13 Mar 2018 18:36:23 -0600 Subject: [PATCH] wallet: demote chainntfns error about out-of-sync blocks to debug --- wallet/chainntfns.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wallet/chainntfns.go b/wallet/chainntfns.go index bd35a8a..af23480 100644 --- a/wallet/chainntfns.go +++ b/wallet/chainntfns.go @@ -6,6 +6,7 @@ package wallet import ( "bytes" + "strings" "github.com/roasbeef/btcd/txscript" "github.com/roasbeef/btcwallet/chain" @@ -135,8 +136,17 @@ func (w *Wallet) handleChainNotifications() { w.rescanNotifications <- n } if err != nil { - log.Errorf("Failed to process consensus server notification "+ - "(name: `%s`, detail: `%v`)", notificationName, err) + // On out-of-sync blockconnected notifications, only + // send a debug message. + errStr := "Failed to process consensus server " + + "notification (name: `%s`, detail: `%v`)" + if notificationName == "blockconnected" && + strings.Contains(err.Error(), + "couldn't get hash from database") { + log.Debugf(errStr, notificationName, err) + } else { + log.Errorf(errStr, notificationName, err) + } } } w.wg.Done()