Skip to content
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
6 changes: 6 additions & 0 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {

// To ensure we can route through this channel now that the peer
// is back online, we'll attempt to send an update to enable it.
// If the channel is already enabled in the database, we won't
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this already be done by the logic further into this execution pipeline? In that it will only send out a new update if this is a shift from the state of the past 20 mins?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, if we have already sent a disable+enable for this channel, the re-enabling will be ignored.

That means that this will only avoid the case where we first connect to a peer after startup, and send out a channel update for all our N channels (if all our peers are online). Maybe still good for the health of the graph not to send out N new updates after each restart?

// send an update, to avoid spamming unnecessarily.
if selfPolicy != nil && selfPolicy.Flags&lnwire.ChanUpdateDisabled == 0 {
continue
}

// This will only be used for non-pending public channels, as
// they are the only ones capable of routing.
chanIsPublic := dbChan.ChannelFlags&lnwire.FFAnnounceChannel != 0
Expand Down