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
joemphilips
added a commit
to joemphilips/cdk
that referenced
this pull request
Nov 11, 2026
ldk-node 0.7.0 marks an in-flight outbound payment Failed when an inbound HTLC uses the same payment hash. cdk-ldk-node reports that status as a failed melt. A melt requester who holds the HTLC of their own invoice and keysends the same hash to the mint could thus release the melt proofs and then settle the HTLC. ldk-node 0.7.1 fixes these bugs: - an inbound HTLC that reuses an outbound payment hash no longer fails the outbound payment (lightningdevkit/ldk-node#1157); - a late PaymentFailed no longer overwrites a succeeded payment (lightningdevkit/ldk-node#1065); - a ChannelManager read error stops the build instead of starting a fresh node (lightningdevkit/ldk-node#1032). lightning 0.2.8 (with lightning-liquidity, lightning-transaction-sync and lightning-persister 0.2.8, and lightning-invoice 0.34.2) fixes: - a malicious BOLT11 route hint that removes channels from the graph (lightningdevkit/rust-lightning#5503); - an MPP startup panic after a channel monitor is archived (#5528); - a ChannelManager that fails to load after several payments to one hash (#5541); - anchor commitments held back when the fee-bump input cannot be funded (4825c089e); - 64-byte transactions skipped in Esplora sync (#5559). Only these six packages change in Cargo.lock and Cargo.lock.msrv. cargo update also re-resolved unrelated multi-version range dependencies, so those edges keep their earlier versions. The other LDK crates are already at their latest compatible releases. The workspace floors now require the fixed versions, so a regenerated lock cannot select the vulnerable ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDmqYFNSovaSho9M89aXC9
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).