use bool instead of int for zombie_required

This commit is contained in:
Christian Grothoff 2020-07-15 14:23:47 +02:00
parent 5d4d5dcaf4
commit d24b062418
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 10 additions and 8 deletions

View File

@ -2017,11 +2017,13 @@ TEH_KS_denomination_key_lookup_by_hash (
struct GNUNET_TIME_Absolute now; struct GNUNET_TIME_Absolute now;
const struct GNUNET_CONTAINER_MultiHashMap *map; const struct GNUNET_CONTAINER_MultiHashMap *map;
map = (TEH_KS_DKU_RECOUP == use) ? key_state->revoked_map : map = (TEH_KS_DKU_RECOUP == use)
key_state->denomkey_map; ? key_state->revoked_map
: key_state->denomkey_map;
dki = GNUNET_CONTAINER_multihashmap_get (map, dki = GNUNET_CONTAINER_multihashmap_get (map,
denom_pub_hash); denom_pub_hash);
if ( (NULL == dki) && (TEH_KS_DKU_ZOMBIE == use)) if ( (NULL == dki) &&
(TEH_KS_DKU_ZOMBIE == use) )
dki = GNUNET_CONTAINER_multihashmap_get (key_state->revoked_map, dki = GNUNET_CONTAINER_multihashmap_get (key_state->revoked_map,
denom_pub_hash); denom_pub_hash);
if (NULL == dki) if (NULL == dki)

View File

@ -151,11 +151,11 @@ struct MeltContext
struct TALER_Amount coin_refresh_fee; struct TALER_Amount coin_refresh_fee;
/** /**
* Set to #GNUNET_YES if this coin's denomination was revoked and the operation * Set to true if this coin's denomination was revoked and the operation
* is thus only allowed for zombie coins where the transaction * is thus only allowed for zombie coins where the transaction
* history includes a #TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP. * history includes a #TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP.
*/ */
int zombie_required; bool zombie_required;
/** /**
* We already checked and noticed that the coin is known. Hence we * We already checked and noticed that the coin is known. Hence we
@ -216,11 +216,11 @@ refresh_check_melt (struct MHD_Connection *connection,
{ {
if (TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP == tp->type) if (TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP == tp->type)
{ {
rmc->zombie_required = GNUNET_NO; /* clear flag: was satisfied! */ rmc->zombie_required = false; /* clear flag: was satisfied! */
break; break;
} }
} }
if (GNUNET_YES == rmc->zombie_required) if (rmc->zombie_required)
{ {
/* zombie status not satisfied */ /* zombie status not satisfied */
GNUNET_break_op (0); GNUNET_break_op (0);
@ -541,7 +541,7 @@ check_for_denomination_key (struct MHD_Connection *connection,
&ec, &ec,
&hc); &hc);
if (NULL != dki) if (NULL != dki)
rmc->zombie_required = GNUNET_YES; /* check later that zombie is satisfied */ rmc->zombie_required = true; /* check later that zombie is satisfied */
} }
if (NULL == dki) if (NULL == dki)
{ {