aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_withdraw2.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-21 03:59:31 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-21 03:59:31 +0100
commitc7e2d206bab7f06375be2154b323ad429d13a9e7 (patch)
tree969cc459e34e9cc88074269e272fd27be38f01f5 /src/lib/exchange_api_withdraw2.c
parent1f86b02ffa60e3817f6a7d70a654f02759e793f3 (diff)
downloadexchange-c7e2d206bab7f06375be2154b323ad429d13a9e7.tar.xz
add logic to check timestamp, revise history balance calculation logic in client
Diffstat (limited to 'src/lib/exchange_api_withdraw2.c')
-rw-r--r--src/lib/exchange_api_withdraw2.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/exchange_api_withdraw2.c b/src/lib/exchange_api_withdraw2.c
index bc138db0f..a5371442f 100644
--- a/src/lib/exchange_api_withdraw2.c
+++ b/src/lib/exchange_api_withdraw2.c
@@ -148,7 +148,8 @@ reserve_withdraw_payment_required (
const json_t *json)
{
struct TALER_Amount balance;
- struct TALER_Amount balance_from_history;
+ struct TALER_Amount total_in_from_history;
+ struct TALER_Amount total_out_from_history;
json_t *history;
size_t len;
struct GNUNET_JSON_Specification spec[] = {
@@ -197,7 +198,8 @@ reserve_withdraw_payment_required (
history,
&wh->reserve_pub,
balance.currency,
- &balance_from_history,
+ &total_in_from_history,
+ &total_out_from_history,
len,
rhistory))
{
@@ -210,14 +212,6 @@ reserve_withdraw_payment_required (
len);
}
- if (0 !=
- TALER_amount_cmp (&balance_from_history,
- &balance))
- {
- /* exchange cannot add up balances!? */
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
/* Check that funds were really insufficient */
if (0 >= TALER_amount_cmp (&wh->requested_amount,
&balance))