routing: pass custom records into pathfinding
This commit is contained in:
parent
d02de70d20
commit
c37289cd94
@ -224,8 +224,8 @@ func (r *RouterBackend) QueryRoutes(ctx context.Context,
|
|||||||
fromNode, toNode, amt,
|
fromNode, toNode, amt,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
DestPayloadTLV: len(in.DestCustomRecords) != 0,
|
DestCustomRecords: record.CustomSet(in.DestCustomRecords),
|
||||||
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
|
||||||
|
@ -289,10 +289,9 @@ type RestrictParams struct {
|
|||||||
// all cltv expiry heights with the required final cltv delta.
|
// all cltv expiry heights with the required final cltv delta.
|
||||||
CltvLimit uint32
|
CltvLimit uint32
|
||||||
|
|
||||||
// DestPayloadTLV should be set to true if we need to drop off a TLV
|
// DestCustomRecords contains the custom records to drop off at the
|
||||||
// payload at the final hop in order to properly complete this payment
|
// final hop, if any.
|
||||||
// attempt.
|
DestCustomRecords record.CustomSet
|
||||||
DestPayloadTLV bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathFindingConfig defines global parameters that control the trade-off in
|
// 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()
|
defer tx.Rollback()
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.DestPayloadTLV {
|
if len(r.DestCustomRecords) > 0 {
|
||||||
// Check if the target has TLV enabled
|
// Check if the target has TLV enabled
|
||||||
|
|
||||||
targetKey, err := btcec.ParsePubKey(target[:], btcec.S256())
|
targetKey, err := btcec.ParsePubKey(target[:], btcec.S256())
|
||||||
|
Loading…
Reference in New Issue
Block a user