-fix balance calculation

This commit is contained in:
Christian Grothoff 2021-12-06 16:37:32 +01:00
parent f3629bdafc
commit 7dcd217b60
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
6 changed files with 18 additions and 14 deletions

View File

@ -46,8 +46,9 @@ enum TALER_EXTENSION_ReturnValue
* The default age mask represents the age groups
* 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-...
*/
#define TALER_EXTENSION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 | 1 << 12 | 1 << \
14 | 1 << 16 | 1 << 18 | 1 << 21)
#define TALER_EXTENSION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 | 1 << 12 | 1 \
<< 14 | 1 << 16 | 1 << 18 | 1 \
<< 21)
/**
* @param groups String representation of age groups, like: "8:10:12:14:16:18:21"

View File

@ -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
{