-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

@ -1866,8 +1866,8 @@ run (void *cls,
MHD_OPTION_CONNECTION_TIMEOUT, MHD_OPTION_CONNECTION_TIMEOUT,
connection_timeout, connection_timeout,
(0 == allow_address_reuse) (0 == allow_address_reuse)
? MHD_OPTION_END ? MHD_OPTION_END
: MHD_OPTION_LISTENING_ADDRESS_REUSE, : MHD_OPTION_LISTENING_ADDRESS_REUSE,
(unsigned int) allow_address_reuse, (unsigned int) allow_address_reuse,
MHD_OPTION_END); MHD_OPTION_END);
if (NULL == mhd) if (NULL == mhd)

View File

@ -2390,8 +2390,8 @@ TEH_keys_get_handler (struct TEH_RequestContext *rc,
MHD_HTTP_OK, MHD_HTTP_OK,
(MHD_YES == (MHD_YES ==
TALER_MHD_can_compress (rc->connection)) TALER_MHD_can_compress (rc->connection))
? krd->response_compressed ? krd->response_compressed
: krd->response_uncompressed); : krd->response_uncompressed);
} }
} }

View File

@ -379,7 +379,7 @@ run (void *cls)
j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
TOTAL); TOTAL);
if (! bm_select ((0 == f)? conn2 : conn, if (! bm_select ((0 == f) ? conn2 : conn,
j)) j))
{ {
GNUNET_PQ_disconnect (conn); GNUNET_PQ_disconnect (conn);
@ -422,7 +422,7 @@ run (void *cls)
j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
TOTAL); TOTAL);
if (! bhm_select ((0 == f)? conn2 : conn, if (! bhm_select ((0 == f) ? conn2 : conn,
j)) j))
{ {
GNUNET_PQ_disconnect (conn); GNUNET_PQ_disconnect (conn);
@ -465,7 +465,7 @@ run (void *cls)
j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
TOTAL); TOTAL);
if (! bem_select ((0 == f)? conn2 : conn, if (! bem_select ((0 == f) ? conn2 : conn,
j)) j))
{ {
GNUNET_PQ_disconnect (conn); GNUNET_PQ_disconnect (conn);

View File

@ -46,8 +46,9 @@ enum TALER_EXTENSION_ReturnValue
* The default age mask represents the age groups * The default age mask represents the age groups
* 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-... * 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 << \ #define TALER_EXTENSION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 | 1 << 12 | 1 \
14 | 1 << 16 | 1 << 18 | 1 << 21) << 14 | 1 << 16 | 1 << 18 | 1 \
<< 21)
/** /**
* @param groups String representation of age groups, like: "8:10:12:14:16:18: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, else if (0 == strcasecmp (type,
"RECOUP-REFRESH")) "RECOUP-REFRESH"))
{ {
/* This is the coin that was subjected to a recoup,
the value being credited to the old coin. */
struct TALER_RecoupRefreshConfirmationPS pc = { struct TALER_RecoupRefreshConfirmationPS pc = {
.purpose.size = htonl (sizeof (pc)), .purpose.size = htonl (sizeof (pc)),
.purpose.purpose = htonl ( .purpose.purpose = htonl (
@ -831,12 +833,13 @@ TALER_EXCHANGE_verify_coin_history (
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
*h_denom_pub = rr.h_denom_pub; *h_denom_pub = rr.h_denom_pub;
add = GNUNET_YES; // FIXME: one of these should be a "NO" add = GNUNET_YES;
// => need better tests!!!
} }
else if (0 == strcasecmp (type, else if (0 == strcasecmp (type,
"OLD-COIN-RECOUP")) "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 = { struct TALER_RecoupRefreshConfirmationPS pc = {
.purpose.size = htonl (sizeof (pc)), .purpose.size = htonl (sizeof (pc)),
.purpose.purpose = htonl ( .purpose.purpose = htonl (
@ -879,7 +882,7 @@ TALER_EXCHANGE_verify_coin_history (
GNUNET_break_op (0); GNUNET_break_op (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
add = GNUNET_YES; // FIXME: one of these should be a "NO" add = GNUNET_NO;
} }
else else
{ {

View File

@ -629,8 +629,8 @@ TALER_EXCHANGE_deposit (
&h_wire, &h_wire,
h_contract_terms, h_contract_terms,
(NULL != extension_details) (NULL != extension_details)
? &ech ? &ech
: NULL, : NULL,
coin_pub, coin_pub,
denom_sig, denom_sig,
denom_pub, denom_pub,