Sea orm integration#3
Closed
dcorral wants to merge 19 commits into
Closed
Conversation
Reordered settle/cancel to avoid deleting claimables before we know the LDK action succeeded. In invoice_settle, call claim_funds first and return an error if LDK rejects it; only then best-effort remove the claimable entry. In invoice_cancel, fetch the claimable without removing it, attempt fail_htlc_backwards, return an error if that fails, and only then clean up the claimable. This prevents losing the ability to retry/cancel when LDK rejects the call.
Add mark_claimable_settling() to atomically mark claimable HTLCs as "settling" before calling claim_funds(), preventing the background expiry task from racing to fail_htlc_backwards on the same payment hash.
settle_twice_succeeds: if the invoice is already settled, settling will succeed; cancel_then_settle_fails: cancel first, settle must fail; settle_then_cancel_fails: settle first, cancel must fail; expire_hodl_invoice: short-expiry path; settle/cancel fail after expiry; expire_hodl_invoice_by_blocks: block-driven expiry; settle/cancel fail after; reject_wrong_preimage_settle: good preimage still suceeds.
Make invoice_settle() idempotent by first checking whether the payment has already succeeded before marking the claimable as settling. This enables safe retries after the claimable entry has been cleaned up by the PaymentClaimed event.
Apply formatting and modify gh action to apply formatting in all push/pr
…ol/rgb-lightning-node into sea-orm-integration
Member
|
Hey! This is how I see the timeline right now:
Let me know if this ordering works @gofman8 |
Author
|
Closed in favor of #4 which has a clean history |
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.
No description provided.