Skip to content

Drop the pending-store entry when removing a payment - #1087

Open
jkczyz wants to merge 1 commit into
lightningdevkit:mainfrom
jkczyz:2026-09-remove-payment-pending-entry
Open

Drop the pending-store entry when removing a payment#1087
jkczyz wants to merge 1 commit into
lightningdevkit:mainfrom
jkczyz:2026-09-remove-payment-pending-entry

Conversation

@jkczyz

@jkczyz jkczyz commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Node::remove_payment left a still-pending on-chain payment's pending-store entry behind, so its txids kept resolving to the removed record — a replacement event for one of them then hits a debug assertion, and nothing ever cleaned the entry up. Removal now drops the entry along with the record; the commit message has the details, and the regression test fails without the fix.

Entries orphaned by removals predating the fix aren't retroactively cleaned, though a repeated remove_payment call now clears one. Only reachable on unreleased main — the pending store isn't in v0.7.0.

Developed with assistance from Claude Code (Claude Fable 5).

Node::remove_payment removed only the payment-store record. For a
still-pending on-chain payment this left an orphaned pending-store
entry that kept resolving the payment's txids (current, conflicting,
and RBF candidates), routing later wallet-sync events to a record that
no longer exists: a replacement event for one of those txids then hits
a debug assertion (and fails the sync in release builds). Nothing ever
cleaned the entry up afterwards, since graduation only removes entries
whose record is still live.

Remove the pending entry along with the record, so a removed payment's
txids no longer resolve. A replacement event for them is then skipped;
other wallet events treat the transaction like any it observes without
a record and may recreate one under a txid-derived id.

Co-Authored-By: Claude <noreply@anthropic.com>
@jkczyz jkczyz added this to the 0.8 milestone Sep 3, 2026
@ldk-reviews-bot

ldk-reviews-bot commented Sep 3, 2026

Copy link
Copy Markdown

👋 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.

@jkczyz
jkczyz requested a review from tnull September 3, 2026 16:06
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.

2 participants