diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-04-10 17:59:33 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-04-10 17:59:33 +0200 |
commit | 1fe26d5d2e7094045fa5c319b047e901ff617d84 (patch) | |
tree | a4b5d1645a809dcc10c2c56a74445c0a1a4f917e /src/exchange-lib/exchange_api_reserve.c | |
parent | 65d74ec0a0cb26b6ffcf1aa5b97488962e990c17 (diff) | |
download | exchange-1fe26d5d2e7094045fa5c319b047e901ff617d84.tar.xz |
also test reserve history after payback
Diffstat (limited to 'src/exchange-lib/exchange_api_reserve.c')
-rw-r--r-- | src/exchange-lib/exchange_api_reserve.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c index 6dd48866f..0ed8cca00 100644 --- a/src/exchange-lib/exchange_api_reserve.c +++ b/src/exchange-lib/exchange_api_reserve.c @@ -274,7 +274,7 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange, &rhistory[off].details.payback_details.exchange_sig), GNUNET_JSON_spec_fixed_auto ("exchange_pub", &rhistory[off].details.payback_details.exchange_pub), - GNUNET_JSON_spec_absolute_time ("timetamp", + GNUNET_JSON_spec_absolute_time ("timestamp", ×tamp), TALER_JSON_spec_amount ("amount", &rhistory[off].amount), @@ -325,6 +325,15 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange, GNUNET_break_op (0); return GNUNET_SYSERR; } + if (GNUNET_OK != + TALER_amount_add (&total_in, + &total_in, + &rhistory[off].amount)) + { + /* overflow in history already!? inconceivable! Bad exchange! */ + GNUNET_break_op (0); + return GNUNET_SYSERR; + } /* end type==PAYBACK */ } else if (0 == strcasecmp (type, |