invoices: treat replayed HTLCs beforehand.

We make sure that HTLCs which have already been decided upon
are resolved before before allowing the external interceptor to
potentially cancel them back. This makes the implementation for
the external HTLC interceptor more streamlined.
This commit is contained in:
ziggie committed 2025-01-29 09:59:02 +01:00
1 parent f25e44712f
commit 9ee12ee029
4 files changed
+125 -38

No files matched your search

+3
View File
@@ -765,6 +765,9 @@ type InvoiceStateUpdateDesc struct {
// InvoiceUpdateCallback is a callback used in the db transaction to update the
// invoice.
// TODO(ziggie): Add the option of additional return values to the callback
// for example the resolution which is currently assigned via an outer scope
// variable.
type InvoiceUpdateCallback = func(invoice *Invoice) (*InvoiceUpdateDesc, error)
// ValidateInvoice assures the invoice passes the checks for all the relevant