summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-15 20:42:47 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-15 20:42:47 +0100
commitc898a1e13b1f06dafec35051dfd232510bd28de3 (patch)
tree5d3bd099b02512744da3f71780da9330a97e8a2e /src/util
parent4322bbf2f1722b4c53114901768772dabdb7e822 (diff)
downloadexchange-c898a1e13b1f06dafec35051dfd232510bd28de3.tar.gz
exchange-c898a1e13b1f06dafec35051dfd232510bd28de3.tar.bz2
exchange-c898a1e13b1f06dafec35051dfd232510bd28de3.zip
clean up closer logic, improve error handling, simplify logic, add comments
Diffstat (limited to 'src/util')
-rw-r--r--src/util/amount.c7
1 files changed, 7 insertions, 0 deletions
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) )
{