discovery: always add chan announcements to the reject cache if err != ErrIgnored

In this commit, we make a change to always add chan announcements to the
reject cache if we didn't reject them for already existing.  Without
this change, if we end up rejecting a channel announcement say because
the channel is already spent or the funding transaction doesn't exist,
then we'll end up continually re-validating the same set of channels we
know will fail, when they're sent to us by peers.

Fixes #5191
This commit is contained in:
Olaoluwa Osuntokun 2021-04-09 14:38:32 -07:00
parent 791a82878d
commit c959ecc4c9
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -1741,6 +1741,10 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(
} else {
log.Tracef("Router rejected channel "+
"edge: %v", err)
d.rejectMtx.Lock()
d.recentRejects[msg.ShortChannelID.ToUint64()] = struct{}{}
d.rejectMtx.Unlock()
}
nMsg.err <- err