diff --git a/client/asset/dcr/dcr.go b/client/asset/dcr/dcr.go index 7049dd6965..091df23ca7 100644 --- a/client/asset/dcr/dcr.go +++ b/client/asset/dcr/dcr.go @@ -6611,7 +6611,7 @@ func (dcr *ExchangeWallet) monitorBlocks(ctx context.Context) { } if walletBlock == nil { - dcr.handleTipChange(ctx, newTip.hash, newTip.height, nil) + dcr.handleTipChange(ctx, newTip.hash, newTip.height) return } @@ -6639,7 +6639,7 @@ func (dcr *ExchangeWallet) monitorBlocks(ctx context.Context) { "never reported: %s (%d). If you see this message repeatedly, it may indicate "+ "an issue with the wallet.", newTip.hash, newTip.height) } - dcr.handleTipChange(ctx, newTip.hash, newTip.height, nil) + dcr.handleTipChange(ctx, newTip.hash, newTip.height) }), } } @@ -6666,7 +6666,7 @@ func (dcr *ExchangeWallet) monitorBlocks(ctx context.Context) { } queuedBlock = nil } - dcr.handleTipChange(ctx, walletTip.hash, walletTip.height, nil) + dcr.handleTipChange(ctx, walletTip.hash, walletTip.height) case <-ctx.Done(): return } @@ -6678,9 +6678,8 @@ func (dcr *ExchangeWallet) monitorBlocks(ctx context.Context) { } } -func (dcr *ExchangeWallet) handleTipChange(ctx context.Context, newTipHash *chainhash.Hash, newTipHeight int64, err error) { - if err != nil { - dcr.log.Error(err) +func (dcr *ExchangeWallet) handleTipChange(ctx context.Context, newTipHash *chainhash.Hash, newTipHeight int64) { + if dcr.ctx.Err() != nil { return } diff --git a/client/core/core.go b/client/core/core.go index 8db99944b5..85cfae4040 100644 --- a/client/core/core.go +++ b/client/core/core.go @@ -9385,10 +9385,10 @@ func handleRedemptionRoute(c *Core, dc *dexConnection, msg *msgjson.Message) err // zero, a resync monitor goroutine is launched to poll SyncStatus until the // wallet has caught up with its network. The monitor goroutine will regularly // emit wallet state notes, and once sync has been restored, a wallet balance -// note will be emitted. If err is non-nil, numPeers should be zero. -func (c *Core) peerChange(w *xcWallet, numPeers uint32, err error) { - if err != nil { - c.log.Warnf("%s wallet communication issue: %q", unbip(w.AssetID), err.Error()) +// note will be emitted. If peerChangeErr is non-nil, numPeers should be zero. +func (c *Core) peerChange(w *xcWallet, numPeers uint32, peerChangeErr error) { + if peerChangeErr != nil { + c.log.Warnf("%s wallet communication issue: %q", unbip(w.AssetID), peerChangeErr.Error()) } else if numPeers == 0 { c.log.Warnf("Wallet for asset %s has zero network peers!", unbip(w.AssetID)) } else { @@ -9423,10 +9423,10 @@ func (c *Core) peerChange(w *xcWallet, numPeers uint32, err error) { // Send a WalletStateNote in case Synced or anything else has changed. if atomic.LoadUint32(w.broadcasting) == 1 { - if (numPeers == 0 || err != nil) && !wasDisconnected { // was connected or initial report - if err != nil { + if (numPeers == 0 || peerChangeErr != nil) && !wasDisconnected { // was connected or initial report + if peerChangeErr != nil { subject, details := c.formatDetails(TopicWalletCommsWarning, - w.Info().Name, err.Error()) + w.Info().Name, peerChangeErr.Error()) c.notify(newWalletConfigNote(TopicWalletCommsWarning, subject, details, db.ErrorLevel, w.state())) } else {