routing: provide payment id to mission control

This commit is contained in:
Joost Jager
2019-06-26 11:48:59 +02:00
parent 334b6a3bfe
commit b4a7665bae
5 changed files with 14 additions and 11 deletions

View File

@ -178,7 +178,7 @@ type MissionController interface {
// input for future probability estimates. It returns a bool indicating
// whether this error is a final error and no further payment attempts
// need to be made.
ReportPaymentFail(rt *route.Route,
ReportPaymentFail(paymentID uint64, rt *route.Route,
failureSourceIdx *int, failure lnwire.FailureMessage) (bool,
channeldb.FailureReason)
@ -1893,13 +1893,15 @@ func (r *ChannelRouter) tryApplyChannelUpdate(rt *route.Route,
// error type, this error is either the final outcome of the payment or we need
// to continue with an alternative route. This is indicated by the boolean
// return value.
func (r *ChannelRouter) processSendError(rt *route.Route, sendErr error) (bool,
channeldb.FailureReason) {
func (r *ChannelRouter) processSendError(paymentID uint64, rt *route.Route,
sendErr error) (bool, channeldb.FailureReason) {
if sendErr == htlcswitch.ErrUnreadableFailureMessage {
log.Tracef("Unreadable failure when sending htlc")
return r.cfg.MissionControl.ReportPaymentFail(rt, nil, nil)
return r.cfg.MissionControl.ReportPaymentFail(
paymentID, rt, nil, nil,
)
}
// If an internal, non-forwarding error occurred, we can stop
// trying.
@ -1926,7 +1928,7 @@ func (r *ChannelRouter) processSendError(rt *route.Route, sendErr error) (bool,
failureSourceIdx)
return r.cfg.MissionControl.ReportPaymentFail(
rt, &failureSourceIdx, failureMessage,
paymentID, rt, &failureSourceIdx, failureMessage,
)
}