Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peer: remove maybeSendNodeAnn #7525

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions peer/brontide.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,19 +661,6 @@ func (p *Brontide) Start() error {
}
}

// Node announcements don't propagate very well throughout the network
// as there isn't a way to efficiently query for them through their
// timestamp, mostly affecting nodes that were offline during the time
// of broadcast. We'll resend our node announcement to the remote peer
// as a best-effort delivery such that it can also propagate to their
// peers. To ensure they can successfully process it in most cases,
// we'll only resend it as long as we have at least one confirmed
// advertised channel with the remote peer.
//
// TODO(wilmer): Remove this once we're able to query for node
// announcements through their timestamps.
p.maybeSendNodeAnn(activeChans)

return nil
}

Expand Down Expand Up @@ -1047,36 +1034,6 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
return p.cfg.Switch.CreateAndAddLink(linkCfg, lnChan)
}

// maybeSendNodeAnn sends our node announcement to the remote peer if at least
// one confirmed public channel exists with them.
func (p *Brontide) maybeSendNodeAnn(channels []*channeldb.OpenChannel) {
hasConfirmedPublicChan := false
for _, channel := range channels {
if channel.IsPending {
continue
}
if channel.ChannelFlags&lnwire.FFAnnounceChannel == 0 {
continue
}

hasConfirmedPublicChan = true
break
}
if !hasConfirmedPublicChan {
return
}

ourNodeAnn, err := p.cfg.GenNodeAnnouncement()
if err != nil {
p.log.Debugf("Unable to retrieve node announcement: %v", err)
return
}

if err := p.SendMessageLazy(false, &ourNodeAnn); err != nil {
p.log.Debugf("Unable to resend node announcement: %v", err)
}
}

// WaitForDisconnect waits until the peer has disconnected. A peer may be
// disconnected if the local or remote side terminates the connection, or an
// irrecoverable protocol error has been encountered. This method will only
Expand Down
Loading