peer: unconditionally add a channel to the switch if it's open

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.
This commit is contained in:
Olaoluwa Osuntokun 2017-12-05 17:53:03 -08:00
parent 9a32bee171
commit ddc5a0fc85
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

11
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()