diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-07-06 10:16:49 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-07-06 10:16:49 +0200 |
commit | 2e7b28765ea2871df03353681f0680c53ec3ebef (patch) | |
tree | 3895a042cc0e54ed325bdefe643b2a66413e75d1 /src/mint | |
parent | 7ad57d7a6708eb451395a78b4c88797844d78d62 (diff) | |
download | exchange-2e7b28765ea2871df03353681f0680c53ec3ebef.tar.xz |
simplifying use of struct TALER_DenominationKeyValidityPS by removing signature
Diffstat (limited to 'src/mint')
-rw-r--r-- | src/mint/taler-mint-httpd_db.c | 12 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_deposit.c | 4 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_keystate.c | 28 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_refresh.c | 10 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_withdraw.c | 4 |
5 files changed, 29 insertions, 29 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index 2ac3defde..4e91e7e76 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c @@ -136,7 +136,7 @@ TMH_DB_execute_deposit (struct MHD_Connection *connection, &deposit->coin.denom_pub, TMH_KS_DKU_DEPOSIT); TALER_amount_ntoh (&value, - &dki->issue.value); + &dki->issue.properties.value); TMH_KS_release (mks); if (GNUNET_OK != @@ -357,9 +357,9 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection, /* calculate amount required including fees */ TALER_amount_ntoh (&value, - &dki->issue.value); + &dki->issue.properties.value); TALER_amount_ntoh (&fee_withdraw, - &dki->issue.fee_withdraw); + &dki->issue.properties.fee_withdraw); if (GNUNET_OK != TALER_amount_add (&amount_required, @@ -399,7 +399,7 @@ TMH_DB_execute_withdraw_sign (struct MHD_Connection *connection, &pos->details.withdraw->denom_pub, TMH_KS_DKU_WITHDRAW); TALER_amount_ntoh (&value, - &tdki->issue.value); + &tdki->issue.properties.value); if (0 == (res & 2)) withdraw_total = value; else @@ -516,7 +516,7 @@ refresh_accept_melts (struct MHD_Connection *connection, const struct TMH_DB_MeltDetails *coin_details, uint16_t oldcoin_index) { - struct TALER_DenominationKeyValidityPS *dki; + struct TALER_MINTDB_DenominationKeyInformationP *dki; struct TALER_MINTDB_TransactionList *tl; struct TALER_Amount coin_value; struct TALER_Amount coin_residual; @@ -535,7 +535,7 @@ refresh_accept_melts (struct MHD_Connection *connection, ? GNUNET_NO : GNUNET_SYSERR; TALER_amount_ntoh (&coin_value, - &dki->value); + &dki->properties.value); /* fee for THIS transaction; the melt amount includes the fee! */ spent = coin_details->melt_amount_with_fee; /* add historic transaction costs of this coin */ diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c index 782d05a8b..c1495c817 100644 --- a/src/mint/taler-mint-httpd_deposit.c +++ b/src/mint/taler-mint-httpd_deposit.c @@ -100,7 +100,7 @@ verify_and_execute_deposit (struct MHD_Connection *connection, "ub_sig"); } TALER_amount_ntoh (&fee_deposit, - &dki->issue.fee_deposit); + &dki->issue.properties.fee_deposit); if (0 < TALER_amount_cmp (&fee_deposit, &deposit->amount_with_fee)) { @@ -188,7 +188,7 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection, "denom_pub"); } TALER_amount_ntoh (&deposit.deposit_fee, - &dki->issue.fee_deposit); + &dki->issue.properties.fee_deposit); TMH_KS_release (ks); deposit.wire = wire; deposit.amount_with_fee = *amount; diff --git a/src/mint/taler-mint-httpd_keystate.c b/src/mint/taler-mint-httpd_keystate.c index d7b64b831..87f2e9b95 100644 --- a/src/mint/taler-mint-httpd_keystate.c +++ b/src/mint/taler-mint-httpd_keystate.c @@ -119,7 +119,7 @@ static int reload_pipe[2]; */ static json_t * denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk, - const struct TALER_DenominationKeyValidityPS *dki) + const struct TALER_MINTDB_DenominationKeyInformationP *dki) { struct TALER_Amount value; struct TALER_Amount fee_withdraw; @@ -127,26 +127,26 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk, struct TALER_Amount fee_refresh; TALER_amount_ntoh (&value, - &dki->value); + &dki->properties.value); TALER_amount_ntoh (&fee_withdraw, - &dki->fee_withdraw); + &dki->properties.fee_withdraw); TALER_amount_ntoh (&fee_deposit, - &dki->fee_deposit); + &dki->properties.fee_deposit); TALER_amount_ntoh (&fee_refresh, - &dki->fee_refresh); + &dki->properties.fee_refresh); return json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}", "master_sig", TALER_json_from_data (&dki->signature, sizeof (struct GNUNET_CRYPTO_EddsaSignature)), "stamp_start", - TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->start)), + TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.start)), "stamp_expire_withdraw", - TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_withdraw)), + TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_withdraw)), "stamp_expire_deposit", - TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_spend)), + TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_spend)), "stamp_expire_legal", - TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_legal)), + TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_legal)), "denom_pub", TALER_json_from_rsa_public_key (pk->rsa_public_key), "value", @@ -214,7 +214,7 @@ reload_keys_denom_iter (void *cls, "Loading denomination key `%s'\n", alias); horizon = GNUNET_TIME_relative_to_absolute (TALER_MINT_conf_duration_provide ()); - if (GNUNET_TIME_absolute_ntoh (dki->issue.start).abs_value_us > + if (GNUNET_TIME_absolute_ntoh (dki->issue.properties.start).abs_value_us > horizon.abs_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -223,7 +223,7 @@ reload_keys_denom_iter (void *cls, return GNUNET_OK; } now = GNUNET_TIME_absolute_get (); - if (GNUNET_TIME_absolute_ntoh (dki->issue.expire_spend).abs_value_us < + if (GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_spend).abs_value_us < now.abs_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -569,7 +569,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state, &hc); now = GNUNET_TIME_absolute_get (); if (now.abs_value_us < - GNUNET_TIME_absolute_ntoh (dki->issue.start).abs_value_us) + GNUNET_TIME_absolute_ntoh (dki->issue.properties.start).abs_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Not returning DKI for %s, as start time is in the future\n", @@ -581,7 +581,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state, { case TMH_KS_DKU_WITHDRAW: if (now.abs_value_us > - GNUNET_TIME_absolute_ntoh (dki->issue.expire_withdraw).abs_value_us) + GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_withdraw).abs_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Not returning DKI for %s, as time to create coins has passed\n", @@ -591,7 +591,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state, break; case TMH_KS_DKU_DEPOSIT: if (now.abs_value_us > - GNUNET_TIME_absolute_ntoh (dki->issue.expire_spend).abs_value_us) + GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_spend).abs_value_us) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Not returning DKI for %s, as time to spend coin has passed\n", diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c index 4fc923759..b1482272c 100644 --- a/src/mint/taler-mint-httpd_refresh.c +++ b/src/mint/taler-mint-httpd_refresh.c @@ -61,7 +61,7 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, { unsigned int i; struct TMH_KS_StateHandle *key_state; - struct TALER_DenominationKeyValidityPS *dki; + struct TALER_MINTDB_DenominationKeyInformationP *dki; struct TALER_Amount cost; struct TALER_Amount total_cost; struct TALER_Amount melt; @@ -80,9 +80,9 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, &denom_pubs[i], TMH_KS_DKU_WITHDRAW)->issue; TALER_amount_ntoh (&value, - &dki->value); + &dki->properties.value); TALER_amount_ntoh (&fee_withdraw, - &dki->fee_withdraw); + &dki->properties.fee_withdraw); if ( (GNUNET_OK != TALER_amount_add (&cost, &value, @@ -109,7 +109,7 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, &coin_melt_details[i].coin_info.denom_pub, TMH_KS_DKU_DEPOSIT)->issue; TALER_amount_ntoh (&fee_melt, - &dki->fee_refresh); + &dki->properties.fee_refresh); if (GNUNET_OK != TALER_amount_subtract (&melt, &coin_melt_details->melt_amount_with_fee, @@ -245,7 +245,7 @@ verify_coin_public_info (struct MHD_Connection *connection, /* FIXME: need to check if denomination key is still valid for issuing! (#3634) */ TALER_amount_ntoh (&fee_refresh, - &dki->issue.fee_refresh); + &dki->issue.properties.fee_refresh); body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS)); body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT); body.session_hash = *session_hash; diff --git a/src/mint/taler-mint-httpd_withdraw.c b/src/mint/taler-mint-httpd_withdraw.c index 877ae8f3c..589cf0a8f 100644 --- a/src/mint/taler-mint-httpd_withdraw.c +++ b/src/mint/taler-mint-httpd_withdraw.c @@ -137,9 +137,9 @@ TMH_WITHDRAW_handler_withdraw_sign (struct TMH_RequestHandler *rh, "denom_pub"); } TALER_amount_ntoh (&amount, - &dki->issue.value); + &dki->issue.properties.value); TALER_amount_ntoh (&fee_withdraw, - &dki->issue.fee_withdraw); + &dki->issue.properties.fee_withdraw); GNUNET_assert (GNUNET_OK == TALER_amount_add (&amount_with_fee, &amount, |