invoices: store custom records in invoice database

This commit is contained in:
Joost Jager committed 2019-12-10 06:54:24 +01:00
1 parent 37258c414c
commit 5f4bd136cd
10 files changed
+725 -584

No files matched your search

+8 -7
View File
@@ -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
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -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 {
+8
View File
@@ -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"