Skip to content

Commit

Permalink
discovery: always add chan announcements to the reject cache if err !…
Browse files Browse the repository at this point in the history
…= 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 lightningnetwork#5191
  • Loading branch information
Roasbeef committed Apr 14, 2021
1 parent 791a828 commit c959ecc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions discovery/gossiper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c959ecc

Please sign in to comment.