mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-04 04:36:21 +01:00
Fix melt change amount
This commit is contained in:
committed by
thesimplekid
parent
11fa39a003
commit
4ba2b07418
@@ -1391,6 +1391,11 @@ impl Wallet {
|
||||
return Err(Error::UnknownQuote);
|
||||
};
|
||||
|
||||
let proofs_total = Amount::try_sum(proofs.iter().map(|p| p.amount))?;
|
||||
if proofs_total < quote_info.amount + quote_info.fee_reserve {
|
||||
return Err(Error::InsufficientFunds);
|
||||
}
|
||||
|
||||
let ys = proofs
|
||||
.iter()
|
||||
.map(|p| p.y())
|
||||
@@ -1410,7 +1415,7 @@ impl Wallet {
|
||||
active_keyset_id,
|
||||
count,
|
||||
self.xpriv,
|
||||
quote_info.fee_reserve,
|
||||
proofs_total - quote_info.amount,
|
||||
)?;
|
||||
|
||||
let melt_response = self
|
||||
|
||||
Reference in New Issue
Block a user