From bf2ce9853e640384106f4dd7c242ea1e5e440871 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 1 Sep 2021 11:11:41 +0200 Subject: add long-time overdue convenience function --- src/util/amount.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util/amount.c') 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. * -- cgit v1.2.3