peer: skip sending active channel updates for pending open channels

In this commit, we skip sending active channel update for pending open
channels as they are not yet part of the graph.
This commit is contained in:
Wilmer Paulino 2018-09-21 17:13:35 -07:00
parent 99a4952239
commit 828ecfe343
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

View File

@ -488,10 +488,12 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
p.activeChannels[chanID] = lnChan
p.activeChanMtx.Unlock()
// Only if the channel is public do we need to collect it for
// sending out a new enable update.
// 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.
// 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
if chanIsPublic {
if chanIsPublic && !dbChan.IsPending {
activePublicChans = append(activePublicChans, *chanPoint)
}
}