diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-04-13 13:11:54 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-04-13 13:11:54 +0200 |
commit | 9e9bad8dad9aacd3028e1baab76de36c8a5dbdc7 (patch) | |
tree | 95bb3ee1bd7f28d5f04f2e2259cb5a06a7c6e69c /src/mint/taler-mint-httpd_responses.c | |
parent | b69e3bf14b5ed73962daa9dfc3f0103b63038177 (diff) |
distinguish active/old denomination keys (#3634)
Diffstat (limited to 'src/mint/taler-mint-httpd_responses.c')
-rw-r--r-- | src/mint/taler-mint-httpd_responses.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index aad96fe72..4cd5f87ed 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -468,8 +468,6 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh, json_t *transaction; int ret; const struct TALER_MINTDB_ReserveHistory *pos; - struct TALER_MINTDB_DenominationKeyIssueInformation *dki; - struct TMH_KS_StateHandle *key_state; struct TALER_WithdrawRequestPS wr; json_history = json_array (); @@ -502,7 +500,6 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh, } } - key_state = TMH_KS_acquire (); ret = 0; for (pos = rh; NULL != pos; pos = pos->next) { @@ -511,29 +508,28 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh, case TALER_MINTDB_RO_BANK_TO_MINT: break; case TALER_MINTDB_RO_WITHDRAW_COIN: - - dki = TMH_KS_denomination_key_lookup (key_state, - &pos->details.withdraw->denom_pub); - TALER_amount_ntoh (&value, - &dki->issue.value); + value = pos->details.withdraw->amount_with_fee; if (0 == ret) + { withdraw_total = value; + } else + { if (GNUNET_OK != TALER_amount_add (&withdraw_total, &withdraw_total, &value)) { - TMH_KS_release (key_state); json_decref (json_history); return NULL; } + } ret = 1; wr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW); wr.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS)); wr.reserve_pub = pos->details.withdraw->reserve_pub; TALER_amount_hton (&wr.amount_with_fee, - &pos->details.withdraw->amount_with_fee); + &value); TALER_amount_hton (&wr.withdraw_fee, &pos->details.withdraw->withdraw_fee); GNUNET_CRYPTO_rsa_public_key_hash (pos->details.withdraw->denom_pub.rsa_public_key, @@ -552,7 +548,6 @@ compile_reserve_history (const struct TALER_MINTDB_ReserveHistory *rh, break; } } - TMH_KS_release (key_state); if (GNUNET_SYSERR == TALER_amount_subtract (balance, |