invoices: store custom records in invoice database
This commit is contained in:
10 files changed
+725
-584
No files matched your search
+7
-3
@@ -3,6 +3,8 @@ package invoices
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
||||
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
@@ -74,6 +76,7 @@ type invoiceUpdateCtx struct {
|
||||
expiry uint32
|
||||
currentHeight int32
|
||||
finalCltvRejectDelta int32
|
||||
customRecords hop.CustomRecordSet
|
||||
}
|
||||
|
||||
// updateInvoice is a callback for DB.UpdateInvoice that contains the invoice
|
||||
@@ -125,9 +128,10 @@ func updateInvoice(ctx *invoiceUpdateCtx, inv *channeldb.Invoice) (
|
||||
// Record HTLC in the invoice database.
|
||||
newHtlcs := map[channeldb.CircuitKey]*channeldb.HtlcAcceptDesc{
|
||||
ctx.circuitKey: {
|
||||
Amt: ctx.amtPaid,
|
||||
Expiry: ctx.expiry,
|
||||
AcceptHeight: ctx.currentHeight,
|
||||
Amt: ctx.amtPaid,
|
||||
Expiry: ctx.expiry,
|
||||
AcceptHeight: ctx.currentHeight,
|
||||
CustomRecords: ctx.customRecords,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user