From 6824517d7578a323beebb473f1fa198761070515 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 8 Oct 2018 14:54:09 +0200 Subject: [PATCH] peer: only send send enable update for disabled chans To avoid spamming on each connection. --- peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peer.go b/peer.go index e95f30ee12c..f35f78f641c 100644 --- a/peer.go +++ b/peer.go @@ -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 + // 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