mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-06 13:09:52 +02:00
routing: rename handleSendError
to handleSwitchErr
This commit renames the `handleSendError` to be `handleSwitchErr` to explicitly express that it's handling the error from htlcswitch.
This commit is contained in:
parent
42f1c0f1cc
commit
bf99e42f8e
@ -330,7 +330,7 @@ lifecycle:
|
|||||||
// We must inspect the error to know whether it was
|
// We must inspect the error to know whether it was
|
||||||
// critical or not, to decide whether we should
|
// critical or not, to decide whether we should
|
||||||
// continue trying.
|
// continue trying.
|
||||||
err := shardHandler.handleSendError(
|
err := shardHandler.handleSwitchErr(
|
||||||
attempt, outcome.err,
|
attempt, outcome.err,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -531,7 +531,7 @@ func (p *shardHandler) collectResultAsync(attempt *channeldb.HTLCAttemptInfo) {
|
|||||||
// Overwrite the param errToSend and return so that the
|
// Overwrite the param errToSend and return so that the
|
||||||
// defer function will use the param to proceed. Notice
|
// defer function will use the param to proceed. Notice
|
||||||
// that the errToSend could be nil here.
|
// that the errToSend could be nil here.
|
||||||
errToSend = p.handleSendError(attempt, result.err)
|
errToSend = p.handleSwitchErr(attempt, result.err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@ -766,7 +766,7 @@ func (p *shardHandler) sendAttempt(
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleSendError inspects the given error from the Switch and determines
|
// handleSwitchErr inspects the given error from the Switch and determines
|
||||||
// whether we should make another payment attempt, or if it should be
|
// whether we should make another payment attempt, or if it should be
|
||||||
// considered a terminal error. Terminal errors will be recorded with the
|
// considered a terminal error. Terminal errors will be recorded with the
|
||||||
// control tower. It analyzes the sendErr for the payment attempt received from
|
// control tower. It analyzes the sendErr for the payment attempt received from
|
||||||
@ -774,7 +774,7 @@ func (p *shardHandler) sendAttempt(
|
|||||||
// the error type, the error is either the final outcome of the payment or we
|
// the error type, the error is either the final outcome of the payment or we
|
||||||
// need to continue with an alternative route. A final outcome is indicated by
|
// need to continue with an alternative route. A final outcome is indicated by
|
||||||
// a non-nil reason value.
|
// a non-nil reason value.
|
||||||
func (p *shardHandler) handleSendError(attempt *channeldb.HTLCAttemptInfo,
|
func (p *shardHandler) handleSwitchErr(attempt *channeldb.HTLCAttemptInfo,
|
||||||
sendErr error) error {
|
sendErr error) error {
|
||||||
|
|
||||||
internalErrorReason := channeldb.FailureReasonError
|
internalErrorReason := channeldb.FailureReasonError
|
||||||
|
@ -2365,7 +2365,7 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
|
|||||||
// 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.
|
||||||
var failureReason *channeldb.FailureReason
|
var failureReason *channeldb.FailureReason
|
||||||
err = sh.handleSendError(attempt, shardError)
|
err = sh.handleSwitchErr(attempt, shardError)
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
// If a non-terminal error is returned and `skipTempErr` is false, then
|
// If a non-terminal error is returned and `skipTempErr` is false, then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user