Skip to content

Commit 841490c

Browse files
authored
Merge pull request #92 from emergent-money/fix/same-mint-melt-no-preimage
Don't panic when a same-mint melt settles without a preimage
2 parents 5a540f6 + 5a43c3e commit 841490c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • orange-sdk/src/trusted_wallet/cashu

orange-sdk/src/trusted_wallet/cashu/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,17 @@ impl Cashu {
730730
},
731731
},
732732
None => {
733-
debug_assert!(
734-
false,
735-
"Melt succeeded but no preimage for quote: {quote_id}"
736-
);
737-
log_error!(
733+
// Expected for same-mint payments: when the melt's
734+
// bolt11 destination is a mint quote on this same
735+
// mint, cdk-mintd settles internally — no Lightning
736+
// payment occurs, so there is no preimage to return.
737+
// The success path below already tolerates None
738+
// (hash falls back to the invoice payment_hash).
739+
log_info!(
738740
logger,
739-
"Melt succeeded but no preimage for quote: {quote_id}"
741+
"Melt for quote {quote_id} settled without a preimage (internal/same-mint settlement)"
740742
);
741-
None // Placeholder, should not happen
743+
None
742744
},
743745
};
744746

0 commit comments

Comments
 (0)