channeldb: don't cancel other HTLCs w/ diff setID once once is settled

With this change, we allow multiple users to concurrently pay the same
AMP invoice with distinct set IDs.
This commit is contained in:
Olaoluwa Osuntokun committed 2021-10-28 15:50:07 -07:00
1 parent 700bae16a3
commit c0f934e363
2 files changed
+12 -7

No files matched your search

+3 -4
View File
@@ -2710,13 +2710,12 @@ func updateHtlc(resolveTime time.Time, htlc *InvoiceHTLC,
}
htlcState = HtlcStateSettled
} else {
htlcState = HtlcStateCanceled
}
// Only persist the changes if the invoice is moving to the
// settled state.
if persist {
// settled state, and we're actually updating the state to
// settled.
if persist && htlcState == HtlcStateSettled {
htlc.State = htlcState
htlc.ResolveTime = resolveTime
}