From e883d2d684d4e060307db67303a1467a749e119a Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Tue, 8 Apr 2025 10:23:42 +0100 Subject: [PATCH] fix: amountless setting --- crates/cdk/src/mint/melt.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/cdk/src/mint/melt.rs b/crates/cdk/src/mint/melt.rs index 49c6fe44..ddad5700 100644 --- a/crates/cdk/src/mint/melt.rs +++ b/crates/cdk/src/mint/melt.rs @@ -33,7 +33,6 @@ impl Mint { ) -> Result<(), Error> { let mint_info = self.localstore.get_mint_info().await?; let nut05 = mint_info.nuts.nut05; - let nut15 = mint_info.nuts.nut15; ensure_cdk!(!nut05.disabled, Error::MeltingDisabled); @@ -43,6 +42,7 @@ impl Mint { let amount = match options { Some(MeltOptions::Mpp { mpp: _ }) => { + let nut15 = mint_info.nuts.nut15; // Verify there is no corresponding mint quote. // Otherwise a wallet is trying to pay someone internally, but // with a multi-part quote. And that's just not possible. @@ -62,13 +62,10 @@ impl Mint { amount } Some(MeltOptions::Amountless { amountless: _ }) => { - if !nut15 - .methods - .into_iter() - .any(|m| m.method == method && m.unit == unit) - { + if !settings.amountless { return Err(Error::AmountlessInvoiceNotSupported(unit, method)); } + amount } None => amount,