From e24ed990a190a5273a00b13ddfba38f58706357c Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 11 Jan 2023 03:43:53 +0100 Subject: [PATCH] comments --- cashu/wallet/wallet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index b9a45f1..cc31331 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -561,11 +561,11 @@ class Wallet(LedgerAPI): ] # "or not p.id" is for backwards compatibility with proofs without a keyset id # select proofs that are not reserved proofs = [p for p in proofs if not p.reserved] - + # check that enough spendable proofs exist if sum_proofs(proofs) < amount_to_send: raise Exception("balance too low.") - # select proofs based on amount to send + # coinselect based on amount to send sorted_proofs = sorted(proofs, key=lambda p: p.amount) send_proofs: List[Proof] = [] while sum_proofs(send_proofs) < amount_to_send: