mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
peer: within loadActiveChannels, skip channel if FundingLocked not processed
This commit fixes a bug to wrap up the recently merged PR to properly handle duplicate FundingLocked retransmissions and also ensure that we reliably re-send the FundingLocked message if we’re unable to the first time around. In this commit, we skip processing a channel that does not yet have a set remote revocation as otherwise, if we attempt to trigger a state update, then we’ll be attempting to manipulate a nil commitment point. Therefore, we’ll rely on the fundingManager to properly send the channel all relevant subsystems.
This commit is contained in:
parent
4153712ba7
commit
171c997fe0
12
peer.go
12
peer.go
@ -292,6 +292,18 @@ 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()
|
||||
|
Loading…
Reference in New Issue
Block a user