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:
Joost Jager committed 2019-12-23 21:51:19 +01:00
1 parent 202b7c26a7
commit 1d5844c196
8 files changed
+212 -3

No files matched your search

+7
View File
@@ -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"
}