Skip to content

Conversation

@okekefrancis112
Copy link
Contributor

Summary

When sending a payment, if the first-hop local channel can't handle it (e.g., HTLC slots full, amount exceeds current max, temporary balance constraint), LDK previously returned APIError::ChannelUnavailable which blacklisted the channel SCID in previously_failed_channels, preventing retries from using it. This PR introduces a new APIError::ChannelBusy variant for these temporary local failures (originating from ChannelError::Ignore in send_htlc_and_commit). Unlike ChannelUnavailable, ChannelBusy does not blacklist the channel, so the router can still select it on retry once the transient condition clears. This is the first step toward addressing #4161 — enabling LDK to automatically retry payments through temporarily-congested channels rather than immediately giving up on them.

Closes: #4161

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 9, 2026

👋 I see @valentinewallace was un-assigned.
If you'd like another reviewer assignment, please click here.

@TheBlueMatt
Copy link
Collaborator

As I mentioned in #4397:

review bandwidth is rather limited, please don't open a flood of PRs at once - give each new PR some time to get review cycles before you open up new ones. If you're looking for ways to contribute, try reviewing existing open PRs! Learning the codebase through review is likely to be way more fruitful than just writing code.

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.02%. Comparing base (2e4a2ac) to head (684ebf3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4403   +/-   ##
=======================================
  Coverage   86.02%   86.02%           
=======================================
  Files         156      156           
  Lines      103100   103106    +6     
  Branches   103100   103106    +6     
=======================================
+ Hits        88693    88699    +6     
  Misses      11896    11896           
  Partials     2511     2511           
Flag Coverage Δ
tests 86.02% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry payment for local failures

3 participants