mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-25 08:35:09 +01:00
Merge pull request #713 from thesimplekid/fix_amountless_enabled_check
fix: amountless setting
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user