From 7dcd217b60b1a5d64cda357473080970f57aeaab Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 6 Dec 2021 16:37:32 +0100 Subject: -fix balance calculation --- src/lib/exchange_api_common.c | 9 ++++++--- src/lib/exchange_api_deposit.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index c5cf4110d..4f6588a20 100644 --- a/src/lib/exchange_api_common.c +++ b/src/lib/exchange_api_common.c @@ -767,6 +767,8 @@ TALER_EXCHANGE_verify_coin_history ( else if (0 == strcasecmp (type, "RECOUP-REFRESH")) { + /* This is the coin that was subjected to a recoup, + the value being credited to the old coin. */ struct TALER_RecoupRefreshConfirmationPS pc = { .purpose.size = htonl (sizeof (pc)), .purpose.purpose = htonl ( @@ -831,12 +833,13 @@ TALER_EXCHANGE_verify_coin_history ( return GNUNET_SYSERR; } *h_denom_pub = rr.h_denom_pub; - add = GNUNET_YES; // FIXME: one of these should be a "NO" - // => need better tests!!! + add = GNUNET_YES; } else if (0 == strcasecmp (type, "OLD-COIN-RECOUP")) { + /* This is the coin that was credited in a recoup, + the value being credited to the this coin. */ struct TALER_RecoupRefreshConfirmationPS pc = { .purpose.size = htonl (sizeof (pc)), .purpose.purpose = htonl ( @@ -879,7 +882,7 @@ TALER_EXCHANGE_verify_coin_history ( GNUNET_break_op (0); return GNUNET_SYSERR; } - add = GNUNET_YES; // FIXME: one of these should be a "NO" + add = GNUNET_NO; } else { diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index bb935514b..8b93f56ef 100644 --- a/src/lib/exchange_api_deposit.c +++ b/src/lib/exchange_api_deposit.c @@ -629,8 +629,8 @@ TALER_EXCHANGE_deposit ( &h_wire, h_contract_terms, (NULL != extension_details) - ? &ech - : NULL, + ? &ech + : NULL, coin_pub, denom_sig, denom_pub, -- cgit v1.2.3