lnrpc+rpcserver: encode custom records as custom channel data

With this commit we encode the custom records as a TLV stream into the
custom channel data field of the invoice HTLC.
This allows the custom data parser to parse those records and replace it
with human-readable JSON on the RPC interface.
This commit is contained in:
Oliver Gugger committed 2024-09-19 09:21:38 +02:00
1 parent bbae7148aa
commit d37df75bc0
9 files changed
+144 -5

No files matched your search

+5
View File
@@ -10,6 +10,7 @@ import (
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/macaroons"
"github.com/lightningnetwork/lnd/netann"
"google.golang.org/protobuf/proto"
)
// Config is the primary configuration struct for the invoices RPC server. It
@@ -69,4 +70,8 @@ type Config struct {
// GetAlias returns the peer's alias SCID if it exists given the
// 32-byte ChannelID.
GetAlias func(lnwire.ChannelID) (lnwire.ShortChannelID, error)
// ParseAuxData is a function that can be used to parse the auxiliary
// data from the invoice.
ParseAuxData func(message proto.Message) error
}