routing: don't treat bad features as an unexpected error

Previous behavior led to the payment loop being abandoned immediately,
resulting in a payment stuck in state in_flight.
This commit is contained in:
Joost Jager committed 2020-05-27 12:15:53 +02:00
1 parent 32b04b7ac3
commit 3ef68baf4a
3 files changed
+23 -9

No files matched your search

+17 -1
View File
@@ -37,6 +37,14 @@ const (
// errEmptyPaySession is returned when the empty payment session is
// queried for a route.
errEmptyPaySession
// errUnknownRequiredFeature is returned when the destination node
// requires an unknown feature.
errUnknownRequiredFeature
// errMissingDependentFeature is returned when the destination node
// misses a feature that a feature that we require depends on.
errMissingDependentFeature
)
var (
@@ -64,6 +72,12 @@ func (e noRouteError) Error() string {
case errInsufficientBalance:
return "insufficient local balance"
case errUnknownRequiredFeature:
return "unknown required feature"
case errMissingDependentFeature:
return "missing dependent feature"
default:
return "unknown no-route error"
}
@@ -76,7 +90,9 @@ func (e noRouteError) FailureReason() channeldb.FailureReason {
errNoTlvPayload,
errNoPaymentAddr,
errNoPathFound,
errEmptyPaySession:
errEmptyPaySession,
errUnknownRequiredFeature,
errMissingDependentFeature:
return channeldb.FailureReasonNoRoute