lnwallet/channel: set logIndex for restored FeeUpdate
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.
This commit is contained in:
parent
1863dcef1f
commit
b593c1c7c7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user