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:
Conner Fromknecht committed 2019-12-18 23:55:08 -08:00
1 parent 71e05e05bf
commit 495ae8ca42
4 files changed
+79 -32

No files matched your search

+6 -2
View File
@@ -129,8 +129,12 @@ func (p *paymentSession) RequestRoute(payment *LightningPayment,
// a route by applying the time-lock and fee requirements.
sourceVertex := route.Vertex(ss.SelfNode.PubKeyBytes)
route, err := newRoute(
payment.Amount, sourceVertex, path, height, finalCltvDelta,
payment.DestCustomRecords,
sourceVertex, path, height,
finalHopParams{
amt: payment.Amount,
cltvDelta: finalCltvDelta,
records: payment.DestCustomRecords,
},
)
if err != nil {
// TODO(roasbeef): return which edge/vertex didn't work