mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-08 06:35:52 +01:00
fix: change amount on melt
This commit is contained in:
@@ -17,7 +17,7 @@ use cashu::url::UncheckedUrl;
|
||||
use cashu::{Amount, Bolt11Invoice};
|
||||
use localstore::LocalStore;
|
||||
use thiserror::Error;
|
||||
use tracing::{debug, warn};
|
||||
use tracing::warn;
|
||||
|
||||
use crate::client::Client;
|
||||
use crate::utils::unix_time;
|
||||
@@ -619,17 +619,19 @@ impl<C: Client, L: LocalStore> Wallet<C, L> {
|
||||
return Err(Error::QuoteUnknown);
|
||||
};
|
||||
|
||||
let proofs = self
|
||||
.select_proofs(mint_url.clone(), "e_info.unit, quote_info.amount)
|
||||
.await?;
|
||||
|
||||
let proofs_amount = proofs.iter().map(|p| p.amount).sum();
|
||||
|
||||
let blinded = PreMintSecrets::blank(
|
||||
self.active_mint_keyset(mint_url, "e_info.unit)
|
||||
.await?
|
||||
.unwrap(),
|
||||
quote_info.fee_reserve,
|
||||
proofs_amount,
|
||||
)?;
|
||||
|
||||
let proofs = self
|
||||
.select_proofs(mint_url.clone(), "e_info.unit, quote_info.amount)
|
||||
.await?;
|
||||
|
||||
let melt_response = self
|
||||
.client
|
||||
.post_melt(
|
||||
|
||||
Reference in New Issue
Block a user