From 828ecfe34379e2f821bb08817394a945ce88fdac Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Fri, 21 Sep 2018 17:13:35 -0700 Subject: [PATCH] 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. --- peer.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/peer.go b/peer.go index 659ccd2e..c03111d3 100644 --- a/peer.go +++ b/peer.go @@ -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) } }