diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index dd918f541..63bec96ee 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -224,8 +224,8 @@ func (r *RouterBackend) QueryRoutes(ctx context.Context, fromNode, toNode, amt, ) }, - DestPayloadTLV: len(in.DestCustomRecords) != 0, - CltvLimit: cltvLimit, + DestCustomRecords: record.CustomSet(in.DestCustomRecords), + CltvLimit: cltvLimit, } // If we have any TLV records destined for the final hop, then we'll diff --git a/routing/pathfind.go b/routing/pathfind.go index e8db244a4..3fa483550 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -289,10 +289,9 @@ type RestrictParams struct { // all cltv expiry heights with the required final cltv delta. CltvLimit uint32 - // DestPayloadTLV should be set to true if we need to drop off a TLV - // payload at the final hop in order to properly complete this payment - // attempt. - DestPayloadTLV bool + // DestCustomRecords contains the custom records to drop off at the + // final hop, if any. + DestCustomRecords record.CustomSet } // PathFindingConfig defines global parameters that control the trade-off in @@ -396,7 +395,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig, defer tx.Rollback() } - if r.DestPayloadTLV { + if len(r.DestCustomRecords) > 0 { // Check if the target has TLV enabled targetKey, err := btcec.ParsePubKey(target[:], btcec.S256())