From cebf2896130ff4a50cc0c5404a474a708c74559a Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Wed, 10 May 2023 00:01:19 -0400 Subject: [PATCH] fix: send proofs change --- src/cashu_wallet.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cashu_wallet.rs b/src/cashu_wallet.rs index 06c7e3ae..ea019943 100644 --- a/src/cashu_wallet.rs +++ b/src/cashu_wallet.rs @@ -162,13 +162,13 @@ impl CashuWallet { let mut send_proofs = SendProofs::default(); for proof in proofs { + let proof_value = proof.amount; if amount_available > amount { send_proofs.change_proofs.push(proof); - break; } else { - amount_available += proof.amount; send_proofs.send_proofs.push(proof); } + amount_available += proof_value; } if amount_available.lt(&amount) {