From 100abb4a30ca9b2d3160663bd03b4355de5d0852 Mon Sep 17 00:00:00 2001 From: Juan Pablo Civile Date: Mon, 6 Sep 2021 18:40:15 -0300 Subject: [PATCH] routing: add test case for result interpretation of Channel Disabled failure --- routing/result_interpretation_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/routing/result_interpretation_test.go b/routing/result_interpretation_test.go index 2fc0a7d90..fff9eaa08 100644 --- a/routing/result_interpretation_test.go +++ b/routing/result_interpretation_test.go @@ -349,6 +349,23 @@ var resultTestCases = []resultTestCase{ nodeFailure: nil, }, }, + + // Test a channel disabled failure from the final hop in two hops. Only the + // disabled channel should be penalized for any amount. + { + name: "two hop channel disabled", + route: &routeTwoHop, + failureSrcIdx: 1, + failure: &lnwire.FailChannelDisabled{}, + + expectedResult: &interpretedResult{ + pairResults: map[DirectedNodePair]pairResult{ + getTestPair(1, 2): failPairResult(0), + getTestPair(2, 1): failPairResult(0), + }, + policyFailure: getPolicyFailure(1, 2), + }, + }, } // TestResultInterpretation executes a list of test cases that test the result