summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-17 20:20:28 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-17 20:20:28 +0100
commita064ca705efe56ded01bc59cf575f17792a4b452 (patch)
tree9d92f0b564d2e9a5ae632f752fb0274bfb6416f6 /src/lib/exchange_api_common.c
parent6c5155ca74287add72e7a9a79bf274f2adc4fb3a (diff)
downloadexchange-a064ca705efe56ded01bc59cf575f17792a4b452.tar.gz
exchange-a064ca705efe56ded01bc59cf575f17792a4b452.tar.bz2
exchange-a064ca705efe56ded01bc59cf575f17792a4b452.zip
check currencies match first
Diffstat (limited to 'src/lib/exchange_api_common.c')
-rw-r--r--src/lib/exchange_api_common.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index 04b87cbb..64975202 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -139,9 +139,12 @@ TALER_EXCHANGE_verify_coin_history (const struct
/* check that deposit fee matches our expectations from /keys! */
TALER_amount_ntoh (&fee,
&dr.deposit_fee);
- if (0 !=
- TALER_amount_cmp (&fee,
- &dk->fee_deposit))
+ if ( (GNUNET_YES !=
+ TALER_amount_cmp_currency (&fee,
+ &dki->fee_deposit)) ||
+ (0 !=
+ TALER_amount_cmp (&fee,
+ &dk->fee_deposit)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -188,9 +191,12 @@ TALER_EXCHANGE_verify_coin_history (const struct
/* check that melt fee matches our expectations from /keys! */
TALER_amount_ntoh (&fee,
&rm.melt_fee);
- if (0 !=
- TALER_amount_cmp (&fee,
- &dk->fee_refresh))
+ if ( (GNUNET_YES !=
+ TALER_amount_cmp_currency (&fee,
+ &dki->fee_refresh)) ||
+ (0 !=
+ TALER_amount_cmp (&fee,
+ &dk->fee_refresh)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -249,9 +255,12 @@ TALER_EXCHANGE_verify_coin_history (const struct
/* check that refund fee matches our expectations from /keys! */
TALER_amount_ntoh (&fee,
&rr.refund_fee);
- if (0 !=
- TALER_amount_cmp (&fee,
- &dk->fee_refund))
+ if ( (GNUNET_YES !=
+ TALER_amount_cmp_currency (&fee,
+ &dki->fee_refund)) ||
+ (0 !=
+ TALER_amount_cmp (&fee,
+ &dk->fee_refund)) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;