summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-01 11:11:41 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-01 11:11:41 +0200
commitbf2ce9853e640384106f4dd7c242ea1e5e440871 (patch)
tree51f5feae3e85ae11a89d77f32c499bba198b447e /src/util
parent896bb8f074d6b6e091ee79de93b8bec118caa3ca (diff)
downloadexchange-bf2ce9853e640384106f4dd7c242ea1e5e440871.tar.gz
exchange-bf2ce9853e640384106f4dd7c242ea1e5e440871.tar.bz2
exchange-bf2ce9853e640384106f4dd7c242ea1e5e440871.zip
add long-time overdue convenience function
Diffstat (limited to 'src/util')
-rw-r--r--src/util/amount.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/amount.c b/src/util/amount.c
index 01f2a2313..ae9ae652e 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -241,6 +241,18 @@ TALER_amount_is_valid (const struct TALER_Amount *amount)
}
+bool
+TALER_amount_is_zero (const struct TALER_Amount *amount)
+{
+ if (GNUNET_OK !=
+ TALER_amount_is_valid (amount))
+ return false;
+ return
+ (0 == amount->value) &&
+ (0 == amount->fraction);
+}
+
+
/**
* Test if @a a is valid, NBO variant.
*