mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 01:03:03 +02:00
routing/payment_lifecycle_test: add step for terminal failure
And modify the MissionControl mock to return a non-nil failure reason in this case.
This commit is contained in:
@@ -101,6 +101,13 @@ func (m *mockMissionControl) ReportPaymentFail(paymentID uint64, rt *route.Route
|
||||
failureSourceIdx *int, failure lnwire.FailureMessage) (
|
||||
*channeldb.FailureReason, error) {
|
||||
|
||||
// Report a permanent failure if this is an error caused
|
||||
// by incorrect details.
|
||||
if failure.Code() == lnwire.CodeIncorrectOrUnknownPaymentDetails {
|
||||
reason := channeldb.FailureReasonPaymentDetails
|
||||
return &reason, nil
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user