routing: use shardHandler to process err in SendToRoute
This commit is contained in:
parent
54aacacc11
commit
1656611358
@ -2163,15 +2163,13 @@ func (r *ChannelRouter) SendToRoute(htlcHash lntypes.Hash, rt *route.Route) (
|
|||||||
// mark the payment failed with the control tower immediately. Process
|
// 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
|
// the error to check if it maps into a terminal error code, if not use
|
||||||
// a generic NO_ROUTE error.
|
// a generic NO_ROUTE error.
|
||||||
reason := r.processSendError(
|
if err := sh.handleSendError(attempt, shardError); err != nil {
|
||||||
attempt.AttemptID, &attempt.Route, shardError,
|
return nil, err
|
||||||
)
|
|
||||||
if reason == nil {
|
|
||||||
r := channeldb.FailureReasonNoRoute
|
|
||||||
reason = &r
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = r.cfg.Control.Fail(paymentIdentifier, *reason)
|
err = r.cfg.Control.Fail(
|
||||||
|
paymentIdentifier, channeldb.FailureReasonNoRoute,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user