invoices: jit insert key send invoices
This commit adds handling code for the key send custom record. If this record is present and its hash matches the payment hash, invoice registry will insert a new invoice into the database "just in time". The subsequent settle flow is unchanged. The newly inserted invoice is picked up and settled. Notifications will be broadcast as usual.
This commit is contained in:
8 files changed
+212
-3
No files matched your search
@@ -85,6 +85,10 @@ const (
|
||||
// ResultInvoiceNotFound is returned when an attempt is made to pay an
|
||||
// invoice that is unknown to us.
|
||||
ResultInvoiceNotFound
|
||||
|
||||
// ResultKeySendError is returned when we receive invalid key send
|
||||
// parameters.
|
||||
ResultKeySendError
|
||||
)
|
||||
|
||||
// String returns a human-readable representation of the invoice update result.
|
||||
@@ -145,6 +149,9 @@ func (u ResolutionResult) String() string {
|
||||
case ResultHtlcSetOverpayment:
|
||||
return "mpp is overpaying set total"
|
||||
|
||||
case ResultKeySendError:
|
||||
return "invalid key send parameters"
|
||||
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user