diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 9ed768e1..ed1b1a18 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -1804,6 +1804,18 @@ func (lc *LightningChannel) restoreStateLogs( return err } + // Earlier versions did not write the log index to disk for fee + // updates, so they will be unset. To account for this we set + // them to to current update log index. + if payDesc.EntryType == FeeUpdate && payDesc.LogIndex == 0 && + lc.localUpdateLog.logIndex > 0 { + + payDesc.LogIndex = lc.localUpdateLog.logIndex + walletLog.Debugf("Found FeeUpdate on "+ + "pendingRemoteCommitDiff without logIndex, "+ + "using %v", payDesc.LogIndex) + } + switch payDesc.EntryType { case Add: // The HtlcIndex of the added HTLC _must_ be equal to