Explicitly reject routes that double-back#2741
Conversation
tnull
left a comment
There was a problem hiding this comment.
Thanks for taking a stab at this!
- If a path within a route passes through the same channelID twice, that shows the path is looped and will be rejected by nodes. - Add a check to explicitly reject such payment before trying to send them.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2741 +/- ##
==========================================
- Coverage 88.55% 88.52% -0.04%
==========================================
Files 113 113
Lines 89330 89351 +21
Branches 89330 89351 +21
==========================================
- Hits 79110 79097 -13
- Misses 7849 7877 +28
- Partials 2371 2377 +6 ☔ View full report in Codecov by Sentry. |
tnull
left a comment
There was a problem hiding this comment.
Pretty much looks good to me. Could we add some test coverage for it though?
You could add a tiny test case checking that we receive the correct APIError if we try to use a looping route. The setup should be similar to, e.g., fn test_update_add_htlc_bolt2_sender_cltv_expiry_too_high() in functional_tests.rs.
- Also modify the unwrap_send_err!() macro to handle the PathParameterError
Resolves #2215