diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-17 15:10:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-17 15:18:09 +0100 |
commit | a351bfc4b4ca15ce7fd998cf9691e85cf84dc426 (patch) | |
tree | 88ec3b739914739f05d4c8cae2a2af40d29ebf82 /src/util/amount.c | |
parent | 8bdf6ab19df70c16d335ecf82f2c3b2117eeb70e (diff) | |
download | exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.xz |
-fix CS nonce reuse check logic
Diffstat (limited to 'src/util/amount.c')
-rw-r--r-- | src/util/amount.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/amount.c b/src/util/amount.c index ae9ae652e..3ce8c0711 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. * |