routing+channeldb: add more failure reasons

This commit is contained in:
Joost Jager committed 2019-07-04 09:27:12 +02:00
1 parent d6d87e12fe
commit ae46fb00cb
7 files changed
+241 -167

No files matched your search

+12 -1
View File
@@ -94,10 +94,17 @@ const (
// destination was found during path finding.
FailureReasonNoRoute FailureReason = 1
// FailureReasonError indicates that an unexpected error happened during
// payment.
FailureReasonError FailureReason = 2
// FailureReasonIncorrectPaymentDetails indicates that either the hash
// is unknown or the final cltv delta or amount is incorrect.
FailureReasonIncorrectPaymentDetails FailureReason = 3
// TODO(halseth): cancel state.
// TODO(joostjager): Add failure reasons for:
// UnknownPaymentHash, FinalInvalidAmt, FinalInvalidCltv
// LocalLiquidityInsufficient, RemoteCapacityInsufficient.
)
@@ -108,6 +115,10 @@ func (r FailureReason) String() string {
return "timeout"
case FailureReasonNoRoute:
return "no_route"
case FailureReasonError:
return "error"
case FailureReasonIncorrectPaymentDetails:
return "incorrect_payment_details"
}
return "unknown"