From 1656611358a34418ac80a745e727f80e62e0e661 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 14 Apr 2021 20:03:36 +0800 Subject: [PATCH] routing: use shardHandler to process err in SendToRoute --- routing/router.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/routing/router.go b/routing/router.go index a4e1ca69..7935ced0 100644 --- a/routing/router.go +++ b/routing/router.go @@ -2163,15 +2163,13 @@ func (r *ChannelRouter) SendToRoute(htlcHash lntypes.Hash, rt *route.Route) ( // mark the payment failed with the control tower immediately. Process // the error to check if it maps into a terminal error code, if not use // a generic NO_ROUTE error. - reason := r.processSendError( - attempt.AttemptID, &attempt.Route, shardError, - ) - if reason == nil { - r := channeldb.FailureReasonNoRoute - reason = &r + if err := sh.handleSendError(attempt, shardError); err != nil { + return nil, err } - err = r.cfg.Control.Fail(paymentIdentifier, *reason) + err = r.cfg.Control.Fail( + paymentIdentifier, channeldb.FailureReasonNoRoute, + ) if err != nil { return nil, err }