routing: use shardHandler to process err in SendToRoute

This commit is contained in:
yyforyongyu committed 2021-06-23 18:13:03 +08:00
1 parent 54aacacc11
commit 1656611358
1 file changed
+5 -7
+5 -7
View File
@@ -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
}