routerrpc: remove payment-level route field

With multi-part payments, a payment-level route field does not make
sense anymore.
This commit is contained in:
Joost Jager
2020-03-30 15:03:50 +02:00
parent dead6a772a
commit acefb64207
3 changed files with 139 additions and 181 deletions

View File

@@ -485,35 +485,6 @@ func (s *Server) trackPayment(paymentHash lntypes.Hash,
status.State = state
}
// Extract the last route from the given list of HTLCs. This
// will populate the legacy route field for backwards
// compatibility.
//
// NOTE: For now there will be at most one HTLC, this code
// should be revisted or the field removed when multiple HTLCs
// are permitted.
var legacyRoute *route.Route
for _, htlc := range result.HTLCs {
switch {
case htlc.Settle != nil:
legacyRoute = &htlc.Route
// Only display the route for failed payments if we got
// an incorrect payment details error, so that it can be
// used for probing or fee estimation.
case htlc.Failure != nil && result.FailureReason ==
channeldb.FailureReasonPaymentDetails:
legacyRoute = &htlc.Route
}
}
if legacyRoute != nil {
status.Route, err = router.MarshallRoute(legacyRoute)
if err != nil {
return err
}
}
// Marshal our list of HTLCs that have been tried for this
// payment.
htlcs := make([]*lnrpc.HTLCAttempt, 0, len(result.HTLCs))