channeldb: split cancelHTLCs logic in the UpdateInvoice method

Previous to this commit we were able to call `UpdateInvoice` with an
updated that added and cancelled htlcs at the same time. The function
returned an error if there was overlapping between the two htlc set.
However, that behavior was not used in the LND code itself.

Eventually we want to split this method in multiple ones, among them one
for canceling htlcs and another one for adding them. For that reason,
this behavior is not supported anymore.
This commit is contained in:
positiveblue
2023-02-01 04:59:01 -08:00
parent 84387992ec
commit a3f6d5c97e
3 changed files with 83 additions and 45 deletions

View File

@@ -711,6 +711,7 @@ func (i *InvoiceRegistry) cancelSingleHtlc(invoiceRef InvoiceRef,
}
return &InvoiceUpdateDesc{
UpdateType: CancelHTLCsUpdate,
CancelHtlcs: canceledHtlcs,
SetID: setID,
}, nil