routing: pass custom records into pathfinding

This commit is contained in:
Joost Jager 2019-12-11 11:49:03 +01:00
parent d02de70d20
commit c37289cd94
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
2 changed files with 6 additions and 7 deletions

@ -224,7 +224,7 @@ func (r *RouterBackend) QueryRoutes(ctx context.Context,
fromNode, toNode, amt,
)
},
DestPayloadTLV: len(in.DestCustomRecords) != 0,
DestCustomRecords: record.CustomSet(in.DestCustomRecords),
CltvLimit: cltvLimit,
}

@ -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())