Drop the pending-store entry when removing a payment - #1087
Open
jkczyz wants to merge 1 commit into
Open
Conversation
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>
|
👋 Thanks for assigning @tnull as a reviewer! |
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.
Node::remove_paymentleft 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_paymentcall now clears one. Only reachable on unreleasedmain— the pending store isn't in v0.7.0.Developed with assistance from Claude Code (Claude Fable 5).