From ddc5a0fc858556227eb7a1e35fb894a87ca8c003 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 5 Dec 2017 17:53:03 -0800 Subject: [PATCH] peer: unconditionally add a channel to the switch if it's open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this commit we revert a prior change which was added after FundingLocked retransmission was implemented. This prior change didn’t factor in the fact that the FundingLocked message will *only* be re-sent after both sides receive the ChannelReestablishment message. With the prior code, as we never added the channel to the link, we’d never re-send the ChannelReestablishment, meaning the other side would never send the FundingLocked message. By unconditionally adding the channel to the switch, we ensure that we’ll always properly retransmit the FundingLocked message. --- peer.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/peer.go b/peer.go index 6df43af8..2a273a68 100644 --- a/peer.go +++ b/peer.go @@ -308,17 +308,6 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error { chanPoint := &dbChan.FundingOutpoint - // If the channel we read form disk has a nil next revocation - // key, then we'll skip loading this channel. We must do this - // as it doesn't yet have the needed items required to initiate - // a local state transition, or one triggered by forwarding an - // HTLC. - if lnChan.RemoteNextRevocation() == nil { - peerLog.Debugf("Skipping ChannelPoint(%v), lacking "+ - "next commit point", chanPoint) - continue - } - chanID := lnwire.NewChanIDFromOutPoint(chanPoint) p.activeChanMtx.Lock()