mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
routing: consolidate final hop params for newRoute
This commit creates a wrapper struct, grouping all parameters that influence the final hop during route construction. This is a preliminary step for passing in the receiver's invoice feature bits, which will be used to select an appropriate payment or payload type.
This commit is contained in:
@ -1454,8 +1454,12 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex,
|
||||
|
||||
// Create the route with absolute time lock values.
|
||||
route, err := newRoute(
|
||||
amt, source, path, uint32(currentHeight), finalCLTVDelta,
|
||||
destCustomRecords,
|
||||
source, path, uint32(currentHeight),
|
||||
finalHopParams{
|
||||
amt: amt,
|
||||
cltvDelta: finalCLTVDelta,
|
||||
records: destCustomRecords,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -2403,7 +2407,11 @@ func (r *ChannelRouter) BuildRoute(amt *lnwire.MilliSatoshi,
|
||||
}
|
||||
|
||||
return newRoute(
|
||||
receiverAmt, source, pathEdges, uint32(height),
|
||||
uint16(finalCltvDelta), nil,
|
||||
source, pathEdges, uint32(height),
|
||||
finalHopParams{
|
||||
amt: receiverAmt,
|
||||
cltvDelta: uint16(finalCltvDelta),
|
||||
records: nil,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user