Merge pull request #713 from thesimplekid/fix_amountless_enabled_check

fix: amountless setting
This commit is contained in:
thesimplekid
2025-04-08 11:16:32 +01:00
committed by GitHub

View File

@@ -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,