From 911886892dd1d53f278c90000c774e3c1a81bbca Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:52:15 +0100 Subject: [PATCH] skip amount refactor (#394) --- cashu/mint/verification.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cashu/mint/verification.py b/cashu/mint/verification.py index f1e9387..48f08b3 100644 --- a/cashu/mint/verification.py +++ b/cashu/mint/verification.py @@ -111,11 +111,9 @@ class LedgerVerification(LedgerSpendingConditions, SupportsKeysets, SupportsDb): raise TransactionError("keyset id inactive.") # Verify amounts of outputs # we skip the amount check for NUT-8 change outputs (which can have amount 0) - if ( - not all([self._verify_amount(o.amount) for o in outputs]) - and not skip_amount_check - ): - raise TransactionError("invalid amount.") + if not skip_amount_check: + if not all([self._verify_amount(o.amount) for o in outputs]): + raise TransactionError("invalid amount.") # verify that only unique outputs were used if not self._verify_no_duplicate_outputs(outputs): raise TransactionError("duplicate outputs.")