Repository navigation
Fixes to payment claim handling - #1157
Merged
Merged
Conversation
If we have sent an outbound payment with a given `payment_hash` and we receive an inbound payment with a matching `payment_hash`, its possible this is an indication of a payment loop, but its also possible its simply a random HTLC with the same hash. We should, thus, not update the outbound payment's status, as it might still be pending and complete. We can detect the payment's failure when the HTLC failure comes back to us as the sender.
If we have already received a payment and marked it as `PaymentStatus::Succeeded` before receiving a second HTLC with the same `payment_hash`, we should leave the payment at `PaymentStatus::Succeeded` rather than reverting it to failed.
`ChannelManager::claim_funds` fails if there are any custom even TLVs. While this is documented, its somewhat deadly for swap services - they might release the preimage in response to a `PaymentClaimable` event and assume they can definitely claim the payment, but LDK will refuse to do so. The `lightning` crate really needs to fix this API for the next release, but for now we should avoid having such an obvious API hole in `ldk-node`.
|
👋 Thanks for assigning @tnull as a reviewer! |
tnull
self-requested a review
October 12, 2026 11:41
tnull
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various tweaks to payment success criteria to make it more robust against surprising changes after resolution (or though-resolution in the case of the claimable-payment commit).