lnrpc+lnrpc/routerrpc: add a new TLV record field to the Hop proto

In this commit, we add a new field to the Hop proto to allow callers to
be able to specify TLV records for the SendToRoute call, and also to be
able to display TLV records that were used during regular path finding.

We also update SendPayment to support dest TLV records.
This commit is contained in:
Olaoluwa Osuntokun
2019-07-30 21:44:02 -07:00
parent 4697cfde30
commit 763cb6c09d
9 changed files with 850 additions and 636 deletions

View File

@@ -249,7 +249,7 @@ func (s *Server) EstimateRouteFee(ctx context.Context,
s.cfg.RouterBackend.SelfNode, destNode, amtMsat,
&routing.RestrictParams{
FeeLimit: feeLimit,
},
}, nil,
)
if err != nil {
return nil, err
@@ -550,9 +550,12 @@ func (s *Server) trackPayment(paymentHash lntypes.Hash,
status.State = PaymentState_SUCCEEDED
status.Preimage = result.Preimage[:]
status.Route = router.MarshallRoute(
status.Route, err = router.MarshallRoute(
result.Route,
)
if err != nil {
return err
}
} else {
state, err := marshallFailureReason(
result.FailureReason,
@@ -562,9 +565,12 @@ func (s *Server) trackPayment(paymentHash lntypes.Hash,
}
status.State = state
if result.Route != nil {
status.Route = router.MarshallRoute(
status.Route, err = router.MarshallRoute(
result.Route,
)
if err != nil {
return err
}
}
}