diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 44974507..d14fea1d 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3161,16 +3161,30 @@ func (lc *LightningChannel) ProcessChanSyncMsg(msg *lnwire.ChannelReestablish) ( lc.remoteCommitChain.tip().height { commitSig, htlcSigs, err := lc.SignNextCommitment() - if err != nil { + switch { + + // If we signed this state, then we'll accumulate + // another update to send over. + case err == nil: + updates = append(updates, &lnwire.CommitSig{ + ChanID: lnwire.NewChanIDFromOutPoint( + &lc.channelState.FundingOutpoint, + ), + CommitSig: commitSig, + HtlcSigs: htlcSigs, + }) + + // If we get a failure due to not knowing their next + // point, then this is fine as they'll either send + // FundingLocked, or revoke their next state to allow + // us to continue forwards. + case err == ErrNoWindow: + + // Otherwise, this is an error and we'll treat it as + // such. + default: return nil, err } - updates = append(updates, &lnwire.CommitSig{ - ChanID: lnwire.NewChanIDFromOutPoint( - &lc.channelState.FundingOutpoint, - ), - CommitSig: commitSig, - HtlcSigs: htlcSigs, - }) } // If we don't owe the remote party a revocation, but their value for