summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-07 16:57:12 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-07 16:57:12 +0200
commit446761b6029298410000181697abef5dbdbd4b57 (patch)
tree0b750b4c34ce8f66e24f6b319fb3dcf5cb5ea221 /src/lib/exchange_api_common.c
parentf0bcbf65862c8e44e245bda21ea078803dcd5ad0 (diff)
downloadexchange-446761b6029298410000181697abef5dbdbd4b57.tar.gz
exchange-446761b6029298410000181697abef5dbdbd4b57.tar.bz2
exchange-446761b6029298410000181697abef5dbdbd4b57.zip
-more minor bugfixes
Diffstat (limited to 'src/lib/exchange_api_common.c')
-rw-r--r--src/lib/exchange_api_common.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index 79e5a31dd..4b36aa932 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -842,21 +842,17 @@ help_melt (struct CoinHistoryParseContext *pc,
return GNUNET_SYSERR;
}
- if (NULL != pc->dk)
+ /* check that melt fee matches our expectations from /keys! */
+ if ( (GNUNET_YES !=
+ TALER_amount_cmp_currency (&melt_fee,
+ &pc->dk->fees.refresh)) ||
+ (0 !=
+ TALER_amount_cmp (&melt_fee,
+ &pc->dk->fees.refresh)) )
{
- /* check that melt fee matches our expectations from /keys! */
- if ( (GNUNET_YES !=
- TALER_amount_cmp_currency (&melt_fee,
- &pc->dk->fees.refresh)) ||
- (0 !=
- TALER_amount_cmp (&melt_fee,
- &pc->dk->fees.refresh)) )
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
}
-
if (GNUNET_OK !=
TALER_wallet_melt_verify (
amount,
@@ -938,26 +934,23 @@ help_refund (struct CoinHistoryParseContext *pc,
return GNUNET_SYSERR;
}
/* NOTE: theoretically, we could also check that the given
- merchant_pub and h_contract_terms appear in the
- history under deposits. However, there is really no benefit
- for the exchange to lie here, so not checking is probably OK
- (an auditor ought to check, though). Then again, we similarly
- had no reason to check the merchant's signature (other than a
- well-formendess check). */
+ merchant_pub and h_contract_terms appear in the
+ history under deposits. However, there is really no benefit
+ for the exchange to lie here, so not checking is probably OK
+ (an auditor ought to check, though). Then again, we similarly
+ had no reason to check the merchant's signature (other than a
+ well-formendess check). */
/* check that refund fee matches our expectations from /keys! */
- if (NULL != pc->dk)
+ if ( (GNUNET_YES !=
+ TALER_amount_cmp_currency (&refund_fee,
+ &pc->dk->fees.refund)) ||
+ (0 !=
+ TALER_amount_cmp (&refund_fee,
+ &pc->dk->fees.refund)) )
{
- if ( (GNUNET_YES !=
- TALER_amount_cmp_currency (&refund_fee,
- &pc->dk->fees.refund)) ||
- (0 !=
- TALER_amount_cmp (&refund_fee,
- &pc->dk->fees.refund)) )
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
}
return GNUNET_NO;
}