From a351bfc4b4ca15ce7fd998cf9691e85cf84dc426 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 17 Feb 2022 15:10:14 +0100 Subject: -fix CS nonce reuse check logic --- src/util/amount.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/util/amount.c') diff --git a/src/util/amount.c b/src/util/amount.c index ae9ae652..3ce8c071 100644 --- a/src/util/amount.c +++ b/src/util/amount.c @@ -253,6 +253,20 @@ TALER_amount_is_zero (const struct TALER_Amount *amount) } +enum GNUNET_GenericReturnValue +TALER_amount_is_currency (const struct TALER_Amount *amount, + const char *currency) +{ + if (GNUNET_OK != + TALER_amount_is_valid (amount)) + return GNUNET_SYSERR; + return (0 == strcasecmp (currency, + amount->currency)) + ? GNUNET_OK + : GNUNET_NO; +} + + /** * Test if @a a is valid, NBO variant. * -- cgit v1.2.3