mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
discovery/gossiper: ignore remote ChannelAnnouncement for own channel
To avoid learning about our own channel we have already closed and removed from our graph, we ignore all ChannelAnns for channels we are involved in.
This commit is contained in:
@@ -542,6 +542,22 @@ func (d *AuthenticatedGossiper) ProcessRemoteAnnouncement(msg lnwire.Message,
|
||||
|
||||
errChan <- nil
|
||||
return errChan
|
||||
|
||||
// To avoid inserting edges in the graph for our own channels that we
|
||||
// have already closed, we ignore such channel announcements coming
|
||||
// from the remote.
|
||||
case *lnwire.ChannelAnnouncement:
|
||||
ownKey := d.selfKey.SerializeCompressed()
|
||||
ownErr := fmt.Errorf("ignoring remote ChannelAnnouncement " +
|
||||
"for own channel")
|
||||
|
||||
if bytes.Equal(m.NodeID1[:], ownKey) ||
|
||||
bytes.Equal(m.NodeID2[:], ownKey) {
|
||||
|
||||
log.Warn(ownErr)
|
||||
errChan <- ownErr
|
||||
return errChan
|
||||
}
|
||||
}
|
||||
|
||||
nMsg := &networkMsg{
|
||||
|
Reference in New Issue
Block a user