htlcswitch: hodl invoice

This commit modifies the invoice registry to handle invoices for which
the preimage is not known yet (hodl invoices). In that case, the
resolution channel passed in from links and resolvers is stored until we
either learn the preimage or want to cancel the htlc.
This commit is contained in:
Joost Jager committed 2019-03-15 10:09:17 +01:00
1 parent 1f41a2abce
commit 32f2b047e8
14 files changed
+1192 -646

No files matched your search

+2
View File
@@ -60,6 +60,8 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
state = lnrpc.Invoice_SETTLED
case channeldb.ContractCanceled:
state = lnrpc.Invoice_CANCELED
case channeldb.ContractAccepted:
state = lnrpc.Invoice_ACCEPTED
default:
return nil, fmt.Errorf("unknown invoice state %v",
invoice.Terms.State)