Don't panic when a same-mint melt settles without a preimage - #92
Merged
benthecarman merged 1 commit intoJul 26, 2026
Merged
Conversation
Collaborator
|
lgtm but is built on #89, can you make this on top of |
When a melt's bolt11 destination is a mint quote on the same mint, cdk-mintd settles it internally — no Lightning payment occurs and the melt result legitimately carries no payment_proof. The success path already tolerates a missing preimage (the event hash falls back to the invoice payment_hash), but the None arm carried a debug_assert!(false) that panics any debug build the moment two wallets sharing a mint pay each other. Downgrade to an explanatory log_info; fixes lightningdevkit#91.
hash-money
force-pushed
the
fix/same-mint-melt-no-preimage
branch
from
July 25, 2026 01:34
356ce16 to
5a43c3e
Compare
Contributor
Author
|
Rebased onto |
benthecarman
approved these changes
Jul 26, 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.
Fixes #91. cdk-mintd settles same-mint payments internally (no Lightning payment → no
payment_proof), so the melt-successNone-preimage arm is a legitimate, reachable case — but it carries adebug_assert!(false)that panics every debug build the moment two wallets sharing a mint pay each other (full repro in #91; hits us on every trusted→trusted transfer between staging test wallets).The success path already handles
None(event hash falls back to the invoicepayment_hash, which is always present for these melts), so the fix is just: stop asserting, log the expected case at info.cargo test -p orange-sdk --lib17/17.