invoices: store custom records in invoice database
This commit is contained in:
10 files changed
+725
-584
No files matched your search
@@ -75,13 +75,14 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
|
||||
}
|
||||
|
||||
rpcHtlc := lnrpc.InvoiceHTLC{
|
||||
ChanId: key.ChanID.ToUint64(),
|
||||
HtlcIndex: key.HtlcID,
|
||||
AcceptHeight: int32(htlc.AcceptHeight),
|
||||
AcceptTime: htlc.AcceptTime.Unix(),
|
||||
ExpiryHeight: int32(htlc.Expiry),
|
||||
AmtMsat: uint64(htlc.Amt),
|
||||
State: state,
|
||||
ChanId: key.ChanID.ToUint64(),
|
||||
HtlcIndex: key.HtlcID,
|
||||
AcceptHeight: int32(htlc.AcceptHeight),
|
||||
AcceptTime: htlc.AcceptTime.Unix(),
|
||||
ExpiryHeight: int32(htlc.Expiry),
|
||||
AmtMsat: uint64(htlc.Amt),
|
||||
State: state,
|
||||
CustomRecords: htlc.CustomRecords,
|
||||
}
|
||||
|
||||
// Only report resolved times if htlc is resolved.
|
||||
|
||||
+569
-558
File diff suppressed because it is too large.
Load diff
@@ -2396,6 +2396,9 @@ message InvoiceHTLC {
|
||||
|
||||
/// Current state the htlc is in.
|
||||
InvoiceHTLCState state = 8 [json_name = "state"];
|
||||
|
||||
/// Custom tlv records.
|
||||
map<uint64, bytes> custom_records = 9 [json_name = "custom_records"];
|
||||
}
|
||||
|
||||
message AddInvoiceResponse {
|
||||
|
||||
@@ -2819,6 +2819,14 @@
|
||||
"state": {
|
||||
"$ref": "#/definitions/lnrpcInvoiceHTLCState",
|
||||
"description": "/ Current state the htlc is in."
|
||||
},
|
||||
"custom_records": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"format": "byte"
|
||||
},
|
||||
"description": "/ Custom tlv records."
|
||||
}
|
||||
},
|
||||
"title": "/ Details of an HTLC that paid to an invoice"
|
||||
|
||||
Reference in new issue
Block a user