Skip to content

Fix duplicate HTLC fail-back on stale force-close #4010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Anyitechs
Copy link
Contributor

This PR addresses the duplicate HTLC fail-back on stale force-close that fail-back one of them and waits till timeout to fail-back everything. This change adds proper tracking of HTLCs by payment hash to ensure all identical HTLCs are failed back immediately when detected, rather than waiting for timeout.

Also introduces a functional test that demonstrates the scenario by creating two identical HTLCs, performing a stale force-close, and verifying both HTLCs are failed back correctly.

Fixes #3570

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Aug 14, 2025

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@Anyitechs
Copy link
Contributor Author

This PR is still work in progress. Need some help with the test, I'm able to simulate the scenario described in the issue but the change introduced is triggered when the node restarts and I'm not sure how to simulate that (did a network disconnection and reconnection, but that doesn't seem to do the job).

@tnull tnull self-requested a review August 15, 2025 13:25
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.

Add test for duplicate HTLC fail-back
2 participants