Merge pull request #3744 from joostjager/enable-custom-records

lnrpc: re-enable custom records
This commit is contained in:
Joost Jager authored and GitHub committed 2019-12-04 14:45:14 +01:00
commit 1371e5affc
12 files changed
+854 -802

No files matched your search

+1 -6
View File
@@ -562,12 +562,7 @@ func deserializeHop(r io.Reader) (*route.Hop, error) {
tlvMap[tlvType] = rawRecordBytes tlvMap[tlvType] = rawRecordBytes
} }
tlvRecords, err := tlv.MapToRecords(tlvMap) h.TLVRecords = tlv.MapToRecords(tlvMap)
if err != nil {
return nil, err
}
h.TLVRecords = tlvRecords
return h, nil return h, nil
} }
+1 -6
View File
@@ -710,12 +710,7 @@ func deserializeHop(r io.Reader) (*route.Hop, error) {
h.MPP = mpp h.MPP = mpp
} }
tlvRecords, err := tlv.MapToRecords(tlvMap) h.TLVRecords = tlv.MapToRecords(tlvMap)
if err != nil {
return nil, err
}
h.TLVRecords = tlvRecords
return h, nil return h, nil
} }
+3 -3
View File
@@ -30,9 +30,9 @@ const (
) )
const ( const (
// customTypeStart is the start of the custom tlv type range as defined // CustomTypeStart is the start of the custom tlv type range as defined
// in BOLT 01. // in BOLT 01.
customTypeStart = 65536 CustomTypeStart = 65536
) )
// String returns a human-readable description of the violation as a verb. // String returns a human-readable description of the violation as a verb.
@@ -249,7 +249,7 @@ func getMinRequiredViolation(set tlv.TypeSet) *tlv.Type {
// //
// We always accept custom fields, because a higher level // We always accept custom fields, because a higher level
// application may understand them. // application may understand them.
if known || t%2 != 0 || t >= customTypeStart { if known || t%2 != 0 || t >= CustomTypeStart {
continue continue
} }
+138 -135
View File
@@ -249,8 +249,10 @@ type SendPaymentRequest struct {
//* //*
//An optional field that can be used to pass an arbitrary set of TLV records //An optional field that can be used to pass an arbitrary set of TLV records
//to a peer which understands the new records. This can be used to pass //to a peer which understands the new records. This can be used to pass
//application specific data during the payment attempt. //application specific data during the payment attempt. Record types are
DestTlv map[uint64][]byte `protobuf:"bytes,11,rep,name=dest_tlv,json=destTlv,proto3" json:"dest_tlv,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //required to be in the custom range >= 65536. When using REST, the values
//must be encoded as base64.
DestCustomRecords map[uint64][]byte `protobuf:"bytes,11,rep,name=dest_custom_records,json=destCustomRecords,proto3" json:"dest_custom_records,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
/// If set, circular payments to self are permitted. /// If set, circular payments to self are permitted.
AllowSelfPayment bool `protobuf:"varint,15,opt,name=allow_self_payment,json=allowSelfPayment,proto3" json:"allow_self_payment,omitempty"` AllowSelfPayment bool `protobuf:"varint,15,opt,name=allow_self_payment,json=allowSelfPayment,proto3" json:"allow_self_payment,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -374,9 +376,9 @@ func (m *SendPaymentRequest) GetRouteHints() []*lnrpc.RouteHint {
return nil return nil
} }
func (m *SendPaymentRequest) GetDestTlv() map[uint64][]byte { func (m *SendPaymentRequest) GetDestCustomRecords() map[uint64][]byte {
if m != nil { if m != nil {
return m.DestTlv return m.DestCustomRecords
} }
return nil return nil
} }
@@ -1486,7 +1488,7 @@ func init() {
proto.RegisterEnum("routerrpc.PaymentState", PaymentState_name, PaymentState_value) proto.RegisterEnum("routerrpc.PaymentState", PaymentState_name, PaymentState_value)
proto.RegisterEnum("routerrpc.Failure_FailureCode", Failure_FailureCode_name, Failure_FailureCode_value) proto.RegisterEnum("routerrpc.Failure_FailureCode", Failure_FailureCode_name, Failure_FailureCode_value)
proto.RegisterType((*SendPaymentRequest)(nil), "routerrpc.SendPaymentRequest") proto.RegisterType((*SendPaymentRequest)(nil), "routerrpc.SendPaymentRequest")
proto.RegisterMapType((map[uint64][]byte)(nil), "routerrpc.SendPaymentRequest.DestTlvEntry") proto.RegisterMapType((map[uint64][]byte)(nil), "routerrpc.SendPaymentRequest.DestCustomRecordsEntry")
proto.RegisterType((*TrackPaymentRequest)(nil), "routerrpc.TrackPaymentRequest") proto.RegisterType((*TrackPaymentRequest)(nil), "routerrpc.TrackPaymentRequest")
proto.RegisterType((*PaymentStatus)(nil), "routerrpc.PaymentStatus") proto.RegisterType((*PaymentStatus)(nil), "routerrpc.PaymentStatus")
proto.RegisterType((*RouteFeeRequest)(nil), "routerrpc.RouteFeeRequest") proto.RegisterType((*RouteFeeRequest)(nil), "routerrpc.RouteFeeRequest")
@@ -1510,136 +1512,137 @@ func init() {
func init() { proto.RegisterFile("routerrpc/router.proto", fileDescriptor_7a0613f69d37b0a5) } func init() { proto.RegisterFile("routerrpc/router.proto", fileDescriptor_7a0613f69d37b0a5) }
var fileDescriptor_7a0613f69d37b0a5 = []byte{ var fileDescriptor_7a0613f69d37b0a5 = []byte{
// 2053 bytes of a gzipped FileDescriptorProto // 2065 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0x5f, 0x73, 0xdb, 0xc6, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xdd, 0x72, 0xdb, 0xc6,
0x11, 0x0f, 0xc4, 0xff, 0x4b, 0x52, 0x84, 0x4e, 0x8a, 0x4c, 0x53, 0x56, 0xa2, 0x20, 0xae, 0xc3, 0x15, 0x0e, 0xc4, 0xff, 0x43, 0x52, 0x84, 0x56, 0x8a, 0x4c, 0x53, 0x56, 0xa2, 0x20, 0xae, 0xc3,
0xf1, 0x38, 0x92, 0xab, 0x4e, 0x32, 0x9e, 0x3c, 0xb4, 0x43, 0x91, 0x60, 0x04, 0x99, 0x04, 0xe5, 0xf1, 0x38, 0x92, 0xab, 0x36, 0x19, 0x4f, 0x2f, 0xda, 0xa1, 0x48, 0x30, 0x82, 0x4c, 0x82, 0xf2,
0x23, 0xe9, 0xc4, 0xcd, 0xc3, 0xcd, 0x89, 0x3c, 0x89, 0x18, 0x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a, 0x87, 0x0f, 0x48, 0x95, 0xa9, 0xb3, 0xdf, 0xfe, 0x55, 0xaa, 0x7d, 0xf9, 0x51, 0x4e, 0xe4, 0xdc, 0x02, 0x58, 0x9e, 0x27, 0xf4, 0x24, 0x31, 0xe5,
0xf1, 0xe4, 0xc6, 0xe1, 0x93, 0xf9, 0xd5, 0xf1, 0xc8, 0x9f, 0x9e, 0xb8, 0xa2, 0xa3, 0xf7, 0x1c, 0x9e, 0x1e, 0xd4, 0x0e, 0x1f, 0xb0, 0x2a, 0x57, 0x67, 0xbf, 0xfe, 0xe3, 0xc9, 0x8d, 0xc3, 0x27,
0xef, 0xc6, 0x63, 0xfc, 0x17, 0x3f, 0xb8, 0x3d, 0x71, 0xbd, 0xf1, 0x89, 0xbc, 0x96, 0x27, 0x0b, 0xf3, 0xab, 0xe3, 0x91, 0x3f, 0x3d, 0x71, 0x45, 0x47, 0xef, 0x39, 0xde, 0x8d, 0xc7, 0xf8, 0xcf,
0x2b, 0x57, 0x59, 0xf9, 0xf7, 0xd0, 0xef, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x2d, 0x5b, 0x7e, 0x70, 0x7b, 0xe2, 0x7a, 0xe3, 0x13, 0x79, 0x2c, 0x4f, 0x16, 0x5e, 0xae, 0xb2, 0xf2, 0xff,
0xa8, 0x4e, 0x12, 0x00, 0x00, 0x48, 0xbf, 0xf9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0xfb, 0xd9, 0x67, 0x77, 0x12, 0x00,
0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
+4 -2
View File
@@ -97,9 +97,11 @@ message SendPaymentRequest {
/** /**
An optional field that can be used to pass an arbitrary set of TLV records An optional field that can be used to pass an arbitrary set of TLV records
to a peer which understands the new records. This can be used to pass to a peer which understands the new records. This can be used to pass
application specific data during the payment attempt. application specific data during the payment attempt. Record types are
required to be in the custom range >= 65536. When using REST, the values
must be encoded as base64.
*/ */
map<uint64, bytes> dest_tlv = 11; map<uint64, bytes> dest_custom_records = 11;
/// If set, circular payments to self are permitted. /// If set, circular payments to self are permitted.
bool allow_self_payment = 15; bool allow_self_payment = 15;
+72 -71
View File
@@ -13,6 +13,7 @@ import (
"github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/htlcswitch/hop"
"github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
@@ -200,7 +201,6 @@ func (r *RouterBackend) QueryRoutes(ctx context.Context,
} }
cltvLimit -= uint32(finalCLTVDelta) cltvLimit -= uint32(finalCLTVDelta)
var destTLV map[uint64][]byte
restrictions := &routing.RestrictParams{ restrictions := &routing.RestrictParams{
FeeLimit: feeLimit, FeeLimit: feeLimit,
ProbabilitySource: func(fromNode, toNode route.Vertex, ProbabilitySource: func(fromNode, toNode route.Vertex,
@@ -226,14 +226,14 @@ func (r *RouterBackend) QueryRoutes(ctx context.Context,
fromNode, toNode, amt, fromNode, toNode, amt,
) )
}, },
DestPayloadTLV: len(destTLV) != 0, DestPayloadTLV: len(in.DestCustomRecords) != 0,
CltvLimit: cltvLimit, CltvLimit: cltvLimit,
} }
// If we have any TLV records destined for the final hop, then we'll // If we have any TLV records destined for the final hop, then we'll
// attempt to decode them now into a form that the router can more // attempt to decode them now into a form that the router can more
// easily manipulate. // easily manipulate.
destTlvRecords, err := tlv.MapToRecords(destTLV) destTlvRecords, err := UnmarshallCustomRecords(in.DestCustomRecords)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -347,6 +347,11 @@ func (r *RouterBackend) MarshallRoute(route *route.Route) (*lnrpc.Route, error)
} }
} }
tlvMap, err := tlv.RecordsToMap(hop.TLVRecords)
if err != nil {
return nil, err
}
resp.Hops[i] = &lnrpc.Hop{ resp.Hops[i] = &lnrpc.Hop{
ChanId: hop.ChannelID, ChanId: hop.ChannelID,
ChanCapacity: int64(chanCapacity), ChanCapacity: int64(chanCapacity),
@@ -358,6 +363,7 @@ func (r *RouterBackend) MarshallRoute(route *route.Route) (*lnrpc.Route, error)
PubKey: hex.EncodeToString( PubKey: hex.EncodeToString(
hop.PubKeyBytes[:], hop.PubKeyBytes[:],
), ),
CustomRecords: tlvMap,
TlvPayload: !hop.LegacyPayload, TlvPayload: !hop.LegacyPayload,
MppRecord: mpp, MppRecord: mpp,
} }
@@ -367,90 +373,87 @@ func (r *RouterBackend) MarshallRoute(route *route.Route) (*lnrpc.Route, error)
return resp, nil return resp, nil
} }
// UnmarshallHopByChannelLookup unmarshalls an rpc hop for which the pub key is // UnmarshallCustomRecords unmarshall rpc custom records to tlv records.
// not known. This function will query the channel graph with channel id to func UnmarshallCustomRecords(rpcRecords map[uint64][]byte) ([]tlv.Record,
// retrieve both endpoints and determine the hop pubkey using the previous hop error) {
// pubkey. If the channel is unknown, an error is returned.
func (r *RouterBackend) UnmarshallHopByChannelLookup(hop *lnrpc.Hop,
prevPubKeyBytes [33]byte) (*route.Hop, error) {
// Discard edge policies, because they may be nil. if len(rpcRecords) == 0 {
node1, node2, err := r.FetchChannelEndpoints(hop.ChanId) return nil, nil
}
tlvRecords := tlv.MapToRecords(rpcRecords)
// tlvRecords is sorted, so we only need to check that the first
// element is within the custom range.
if uint64(tlvRecords[0].Type()) < hop.CustomTypeStart {
return nil, fmt.Errorf("no custom records with types "+
"below %v allowed", hop.CustomTypeStart)
}
return tlvRecords, nil
}
// UnmarshallHopWithPubkey unmarshalls an rpc hop for which the pubkey has
// already been extracted.
func UnmarshallHopWithPubkey(rpcHop *lnrpc.Hop, pubkey route.Vertex) (*route.Hop,
error) {
tlvRecords, err := UnmarshallCustomRecords(rpcHop.CustomRecords)
if err != nil { if err != nil {
return nil, err return nil, err
} }
var pubKeyBytes [33]byte mpp, err := UnmarshalMPP(rpcHop.MppRecord)
switch {
case prevPubKeyBytes == node1:
pubKeyBytes = node2
case prevPubKeyBytes == node2:
pubKeyBytes = node1
default:
return nil, fmt.Errorf("channel edge does not match expected node")
}
var tlvRecords []tlv.Record
mpp, err := UnmarshalMPP(hop.MppRecord)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &route.Hop{ return &route.Hop{
OutgoingTimeLock: hop.Expiry, OutgoingTimeLock: rpcHop.Expiry,
AmtToForward: lnwire.MilliSatoshi(hop.AmtToForwardMsat), AmtToForward: lnwire.MilliSatoshi(rpcHop.AmtToForwardMsat),
PubKeyBytes: pubKeyBytes, PubKeyBytes: pubkey,
ChannelID: hop.ChanId, ChannelID: rpcHop.ChanId,
TLVRecords: tlvRecords, TLVRecords: tlvRecords,
LegacyPayload: !hop.TlvPayload, LegacyPayload: !rpcHop.TlvPayload,
MPP: mpp,
}, nil
}
// UnmarshallKnownPubkeyHop unmarshalls an rpc hop that contains the hop pubkey.
// The channel graph doesn't need to be queried because all information required
// for sending the payment is present.
func UnmarshallKnownPubkeyHop(hop *lnrpc.Hop) (*route.Hop, error) {
pubKey, err := hex.DecodeString(hop.PubKey)
if err != nil {
return nil, fmt.Errorf("cannot decode pubkey %s", hop.PubKey)
}
var pubKeyBytes [33]byte
copy(pubKeyBytes[:], pubKey)
var tlvRecords []tlv.Record
mpp, err := UnmarshalMPP(hop.MppRecord)
if err != nil {
return nil, err
}
return &route.Hop{
OutgoingTimeLock: hop.Expiry,
AmtToForward: lnwire.MilliSatoshi(hop.AmtToForwardMsat),
PubKeyBytes: pubKeyBytes,
ChannelID: hop.ChanId,
TLVRecords: tlvRecords,
LegacyPayload: !hop.TlvPayload,
MPP: mpp, MPP: mpp,
}, nil }, nil
} }
// UnmarshallHop unmarshalls an rpc hop that may or may not contain a node // UnmarshallHop unmarshalls an rpc hop that may or may not contain a node
// pubkey. // pubkey.
func (r *RouterBackend) UnmarshallHop(hop *lnrpc.Hop, func (r *RouterBackend) UnmarshallHop(rpcHop *lnrpc.Hop,
prevNodePubKey [33]byte) (*route.Hop, error) { prevNodePubKey [33]byte) (*route.Hop, error) {
if hop.PubKey == "" { var pubKeyBytes [33]byte
// If no pub key is given of the hop, the local channel if rpcHop.PubKey != "" {
// graph needs to be queried to complete the information // Unmarshall the provided hop pubkey.
// necessary for routing. pubKey, err := hex.DecodeString(rpcHop.PubKey)
return r.UnmarshallHopByChannelLookup(hop, prevNodePubKey) if err != nil {
return nil, fmt.Errorf("cannot decode pubkey %s",
rpcHop.PubKey)
}
copy(pubKeyBytes[:], pubKey)
} else {
// If no pub key is given of the hop, the local channel graph
// needs to be queried to complete the information necessary for
// routing. Discard edge policies, because they may be nil.
node1, node2, err := r.FetchChannelEndpoints(rpcHop.ChanId)
if err != nil {
return nil, err
} }
return UnmarshallKnownPubkeyHop(hop) switch {
case prevNodePubKey == node1:
pubKeyBytes = node2
case prevNodePubKey == node2:
pubKeyBytes = node1
default:
return nil, fmt.Errorf("channel edge does not match " +
"expected node")
}
}
return UnmarshallHopWithPubkey(rpcHop, pubKeyBytes)
} }
// UnmarshallRoute unmarshalls an rpc route. For hops that don't specify a // UnmarshallRoute unmarshalls an rpc route. For hops that don't specify a
@@ -531,14 +534,12 @@ func (r *RouterBackend) extractIntentFromSendRequest(
return nil, errors.New("timeout_seconds must be specified") return nil, errors.New("timeout_seconds must be specified")
} }
var destTLV map[uint64][]byte payIntent.FinalDestRecords, err = UnmarshallCustomRecords(
if len(destTLV) != 0 { rpcPayReq.DestCustomRecords,
var err error )
payIntent.FinalDestRecords, err = tlv.MapToRecords(destTLV)
if err != nil { if err != nil {
return nil, err return nil, err
} }
}
payIntent.PayAttemptTimeout = time.Second * payIntent.PayAttemptTimeout = time.Second *
time.Duration(rpcPayReq.TimeoutSeconds) time.Duration(rpcPayReq.TimeoutSeconds)
+596 -561
View File
File diff suppressed because it is too large. Load diff
+23 -4
View File
@@ -952,10 +952,11 @@ message SendRequest {
/** /**
An optional field that can be used to pass an arbitrary set of TLV records An optional field that can be used to pass an arbitrary set of TLV records
to a peer which understands the new records. This can be used to pass to a peer which understands the new records. This can be used to pass
application specific data during the payment attempt. When using REST, the application specific data during the payment attempt. Record types are
values must be encoded as base64. required to be in the custom range >= 65536. When using REST, the values
must be encoded as base64.
*/ */
map<uint64, bytes> dest_tlv = 11; map<uint64, bytes> dest_custom_records = 11;
/// If set, circular payments to self are permitted. /// If set, circular payments to self are permitted.
bool allow_self_payment = 14; bool allow_self_payment = 14;
@@ -1857,6 +1858,16 @@ message QueryRoutesRequest {
zero, then the value of `--max-cltv-expiry` is used as the limit. zero, then the value of `--max-cltv-expiry` is used as the limit.
*/ */
uint32 cltv_limit = 11; uint32 cltv_limit = 11;
/**
An optional field that can be used to pass an arbitrary set of TLV records
to a peer which understands the new records. This can be used to pass
application specific data during the payment attempt. If the destination
does not support the specified recrods, and error will be returned.
Record types are required to be in the custom range >= 65536. When using
REST, the values must be encoded as base64.
*/
map<uint64, bytes> dest_custom_records = 13;
} }
message NodePair { message NodePair {
@@ -1922,7 +1933,8 @@ message Hop {
/** /**
If set to true, then this hop will be encoded using the new variable length If set to true, then this hop will be encoded using the new variable length
TLV format. TLV format. Note that if any custom tlv_records below are specified, then
this field MUST be set to true for them to be encoded properly.
*/ */
bool tlv_payload = 9 [json_name = "tlv_payload"]; bool tlv_payload = 9 [json_name = "tlv_payload"];
@@ -1933,6 +1945,13 @@ message Hop {
regular single-shot payment is or was attempted. regular single-shot payment is or was attempted.
*/ */
MPPRecord mpp_record = 10 [json_name = "mpp_record"]; MPPRecord mpp_record = 10 [json_name = "mpp_record"];
/**
An optional set of key-value TLV records. This is useful within the context
of the SendToRoute call as it allows callers to specify arbitrary K-V pairs
to drop off at each hop within the onion.
*/
map<uint64, bytes> custom_records = 11 [json_name = "custom_records"];
} }
message MPPRecord { message MPPRecord {
+11 -3
View File
@@ -2582,11 +2582,19 @@
"tlv_payload": { "tlv_payload": {
"type": "boolean", "type": "boolean",
"format": "boolean", "format": "boolean",
"description": "* \nIf set to true, then this hop will be encoded using the new variable length\nTLV format." "description": "* \nIf set to true, then this hop will be encoded using the new variable length\nTLV format. Note that if any custom tlv_records below are specified, then\nthis field MUST be set to true for them to be encoded properly."
}, },
"mpp_record": { "mpp_record": {
"$ref": "#/definitions/lnrpcMPPRecord", "$ref": "#/definitions/lnrpcMPPRecord",
"description": "*\nAn optional TLV record tha singals the use of an MPP payment. If present,\nthe receiver will enforce that that the same mpp_record is included in the\nfinal hop payload of all non-zero payments in the HTLC set. If empty, a\nregular single-shot payment is or was attempted." "description": "*\nAn optional TLV record tha singals the use of an MPP payment. If present,\nthe receiver will enforce that that the same mpp_record is included in the\nfinal hop payload of all non-zero payments in the HTLC set. If empty, a\nregular single-shot payment is or was attempted."
},
"custom_records": {
"type": "object",
"additionalProperties": {
"type": "string",
"format": "byte"
},
"description": "*\nAn optional set of key-value TLV records. This is useful within the context\nof the SendToRoute call as it allows callers to specify arbitrary K-V pairs\nto drop off at each hop within the onion."
} }
} }
}, },
@@ -3710,13 +3718,13 @@
"format": "int64", "format": "int64",
"description": "* \nAn optional maximum total time lock for the route. This should not exceed\nlnd's `--max-cltv-expiry` setting. If zero, then the value of\n`--max-cltv-expiry` is enforced." "description": "* \nAn optional maximum total time lock for the route. This should not exceed\nlnd's `--max-cltv-expiry` setting. If zero, then the value of\n`--max-cltv-expiry` is enforced."
}, },
"dest_tlv": { "dest_custom_records": {
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
"type": "string", "type": "string",
"format": "byte" "format": "byte"
}, },
"description": "* \nAn optional field that can be used to pass an arbitrary set of TLV records\nto a peer which understands the new records. This can be used to pass\napplication specific data during the payment attempt. When using REST, the\nvalues must be encoded as base64." "description": "* \nAn optional field that can be used to pass an arbitrary set of TLV records\nto a peer which understands the new records. This can be used to pass\napplication specific data during the payment attempt. Record types are\nrequired to be in the custom range \u003e= 65536. When using REST, the values\nmust be encoded as base64."
}, },
"allow_self_payment": { "allow_self_payment": {
"type": "boolean", "type": "boolean",
+2 -5
View File
@@ -3133,15 +3133,12 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme
} }
payIntent.cltvLimit = cltvLimit payIntent.cltvLimit = cltvLimit
if len(rpcPayReq.DestTlv) != 0 { payIntent.destTLV, err = routerrpc.UnmarshallCustomRecords(
var err error rpcPayReq.DestCustomRecords,
payIntent.destTLV, err = tlv.MapToRecords(
rpcPayReq.DestTlv,
) )
if err != nil { if err != nil {
return payIntent, err return payIntent, err
} }
}
validateDest := func(dest route.Vertex) error { validateDest := func(dest route.Vertex) error {
if rpcPayReq.AllowSelfPayment { if rpcPayReq.AllowSelfPayment {
+2 -2
View File
@@ -219,7 +219,7 @@ func StubEncoder(v []byte) Encoder {
// MapToRecords encodes the passed TLV map as a series of regular tlv.Record // MapToRecords encodes the passed TLV map as a series of regular tlv.Record
// instances. The resulting set of records will be returned in sorted order by // instances. The resulting set of records will be returned in sorted order by
// their type. // their type.
func MapToRecords(tlvMap map[uint64][]byte) ([]Record, error) { func MapToRecords(tlvMap map[uint64][]byte) []Record {
records := make([]Record, 0, len(tlvMap)) records := make([]Record, 0, len(tlvMap))
for k, v := range tlvMap { for k, v := range tlvMap {
// We don't pass in a decoder here since we don't actually know // We don't pass in a decoder here since we don't actually know
@@ -234,7 +234,7 @@ func MapToRecords(tlvMap map[uint64][]byte) ([]Record, error) {
SortRecords(records) SortRecords(records)
return records, nil return records
} }
// SortRecords is a helper function that will sort a slice of records in place // SortRecords is a helper function that will sort a slice of records in place
+1 -4
View File
@@ -114,10 +114,7 @@ func TestRecordMapTransformation(t *testing.T) {
spew.Sdump(mappedRecords)) spew.Sdump(mappedRecords))
} }
unmappedRecords, err := MapToRecords(mappedRecords) unmappedRecords := MapToRecords(mappedRecords)
if err != nil {
t.Fatalf("#%v: unable to unmap records: %v", i, err)
}
for i := 0; i < len(testCase.records); i++ { for i := 0; i < len(testCase.records); i++ {
if unmappedRecords[i].Type() != testCase.records[i].Type() { if unmappedRecords[i].Type() != testCase.records[i].Type() {