From 26aa9d985e2f9ba6ce3895e7e2625226e2008bfb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 29 Dec 2022 11:48:57 +0100 Subject: expand DB API with AML functions, fix purse refund calculations in libtalerexchange --- src/lib/exchange_api_common.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/lib/exchange_api_common.c') diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index 3807b997f..b895bf9a8 100644 --- a/src/lib/exchange_api_common.c +++ b/src/lib/exchange_api_common.c @@ -1336,15 +1336,11 @@ help_purse_deposit (struct CoinHistoryParseContext *pc, } if (refunded) { - /* We add the amount to refunds here, the original - deposit will be added to the balance later because - we still return GNUNET_YES, thus effectively - cancelling out this operation with respect to - the final balance. */ + /* We wave the deposit fee. */ if (0 > TALER_amount_add (&pc->rtotal, &pc->rtotal, - amount)) + &pc->dk->fees.deposit)) { /* overflow in refund history? inconceivable! Bad exchange! */ GNUNET_break_op (0); @@ -1415,15 +1411,6 @@ help_purse_refund (struct CoinHistoryParseContext *pc, GNUNET_break_op (0); return GNUNET_SYSERR; } - if (0 > - TALER_amount_add (&pc->rtotal, - &pc->rtotal, - amount)) - { - /* overflow in refund history? inconceivable! Bad exchange! */ - GNUNET_break_op (0); - return GNUNET_SYSERR; - } return GNUNET_NO; } -- cgit v1.2.3