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:
14 files changed
+1192
-646
No files matched your search
@@ -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)
|
||||
|
||||
+574
-570
File diff suppressed because it is too large.
Load diff
@@ -1892,6 +1892,7 @@ message Invoice {
|
||||
OPEN = 0;
|
||||
SETTLED = 1;
|
||||
CANCELED = 2;
|
||||
ACCEPTED = 3;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1162,7 +1162,8 @@
|
||||
"enum": [
|
||||
"OPEN",
|
||||
"SETTLED",
|
||||
"CANCELED"
|
||||
"CANCELED",
|
||||
"ACCEPTED"
|
||||
],
|
||||
"default": "OPEN"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user