multi: replace errInvoiceNotFound with resolution result
This commit moves handling of invoice not found errors into NotifyExitHopHtlc and exposes a resolution result to the calling functions. The intention of this change is to make calling functions as naive of the invoice registry's mechanics as possible. When NotifyExitHopHtlc is called and an invoice is not found, calling functions can take action based on the HtlcResolution's InvoiceNotFound outcome rather than having to add a special error check on every call to handle the error.
This commit is contained in:
6 files changed
+54
-36
No files matched your search
@@ -81,6 +81,10 @@ const (
|
||||
|
||||
// ResultHtlcSetOverpayment is returned when a mpp set is overpaid.
|
||||
ResultHtlcSetOverpayment
|
||||
|
||||
// ResultInvoiceNotFound is returned when an attempt is made to pay an
|
||||
// invoice that is unknown to us.
|
||||
ResultInvoiceNotFound
|
||||
)
|
||||
|
||||
// String returns a human-readable representation of the invoice update result.
|
||||
|
||||
Reference in new issue
Block a user