summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_coins_history.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-11-09 22:27:20 +0100
committerChristian Grothoff <grothoff@gnunet.org>2023-11-09 22:27:20 +0100
commit41780a7f4ad1e4d68c57ca10f6521b89156772d6 (patch)
tree7dbd68656582b2d5e6d150581963556348f916c6 /src/lib/exchange_api_coins_history.c
parent4cafd4046ff1405e37018a4909de3b9858b93144 (diff)
downloadexchange-41780a7f4ad1e4d68c57ca10f6521b89156772d6.tar.gz
exchange-41780a7f4ad1e4d68c57ca10f6521b89156772d6.tar.bz2
exchange-41780a7f4ad1e4d68c57ca10f6521b89156772d6.zip
add support for purse deposits in coin history checking
Diffstat (limited to 'src/lib/exchange_api_coins_history.c')
-rw-r--r--src/lib/exchange_api_coins_history.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/exchange_api_coins_history.c b/src/lib/exchange_api_coins_history.c
index b74e1a9b0..875a5b57b 100644
--- a/src/lib/exchange_api_coins_history.c
+++ b/src/lib/exchange_api_coins_history.c
@@ -802,11 +802,10 @@ TALER_EXCHANGE_parse_coin_history (
json_t *transaction = json_array_get (history,
off);
enum GNUNET_GenericReturnValue add;
- struct TALER_Amount amount;
const char *type;
struct GNUNET_JSON_Specification spec_glob[] = {
TALER_JSON_spec_amount_any ("amount",
- &amount),
+ &rh->amount),
GNUNET_JSON_spec_string ("type",
&type),
GNUNET_JSON_spec_end ()
@@ -821,7 +820,7 @@ TALER_EXCHANGE_parse_coin_history (
return GNUNET_SYSERR;
}
if (GNUNET_YES !=
- TALER_amount_cmp_currency (&amount,
+ TALER_amount_cmp_currency (&rh->amount,
total_in))
{
GNUNET_break_op (0);
@@ -830,7 +829,7 @@ TALER_EXCHANGE_parse_coin_history (
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Operation of type %s with amount %s\n",
type,
- TALER_amount2s (&amount));
+ TALER_amount2s (&rh->amount));
add = GNUNET_SYSERR;
for (unsigned int i = 0; NULL != map[i].type; i++)
{
@@ -840,7 +839,7 @@ TALER_EXCHANGE_parse_coin_history (
rh->type = map[i].ctt;
add = map[i].helper (&pc,
rh,
- &amount,
+ &rh->amount,
transaction);
break;
}
@@ -860,7 +859,7 @@ TALER_EXCHANGE_parse_coin_history (
if (0 >
TALER_amount_add (total_out,
total_out,
- &amount))
+ &rh->amount))
{
/* overflow in history already!? inconceivable! Bad exchange! */
GNUNET_break_op (0);
@@ -872,7 +871,7 @@ TALER_EXCHANGE_parse_coin_history (
if (0 >
TALER_amount_add (total_in,
total_in,
- &amount))
+ &rh->amount))
{
/* overflow in refund history? inconceivable! Bad exchange! */
GNUNET_break_op (0);