server: avoid logging error if no links are found

In this commit, we avoid logging an error when the links associated with
a peer are not found within its termination watcher. We do this to
prevent a benign log message as the links have already been removed from
the switch.
This commit is contained in:
Wilmer Paulino 2018-08-28 20:10:35 -07:00
parent 33dda07b62
commit 16b412fb51
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

View File

@ -2449,8 +2449,9 @@ func (s *server) peerTerminationWatcher(p *peer, ready chan struct{}) {
//
// TODO(roasbeef): instead add a PurgeInterfaceLinks function?
links, err := p.server.htlcSwitch.GetLinksByInterface(p.pubKeyBytes)
if err != nil {
srvrLog.Errorf("unable to get channel links: %v", err)
if err != nil && err != htlcswitch.ErrNoLinksFound {
srvrLog.Errorf("Unable to get channel links for %x: %v",
p.pubKeyBytes, err)
}
for _, link := range links {