From c898a1e13b1f06dafec35051dfd232510bd28de3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Mar 2020 20:42:47 +0100 Subject: clean up closer logic, improve error handling, simplify logic, add comments --- src/util/amount.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util/amount.c') diff --git a/src/util/amount.c b/src/util/amount.c index e443a0d24..fb5a41d74 100644 --- a/src/util/amount.c +++ b/src/util/amount.c @@ -709,6 +709,13 @@ int TALER_amount_round_down (struct TALER_Amount *amount, const struct TALER_Amount *round_unit) { + if (GNUNET_OK != + TALER_amount_cmp_currency (amount, + round_unit)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } if ( (0 != round_unit->fraction) && (0 != round_unit->value) ) { -- cgit v1.2.3