From 8ca555500f01ebb2f7286961588b81b4ee5ac4fe Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 29 Jan 2015 19:01:29 +0100 Subject: more notes about issues in bug tracker --- src/mint/taler-mint-httpd_refresh.c | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/mint/taler-mint-httpd_refresh.c') diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c index 8bc8e778..e7497327 100644 --- a/src/mint/taler-mint-httpd_refresh.c +++ b/src/mint/taler-mint-httpd_refresh.c @@ -167,6 +167,12 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, struct RefreshMeltSignatureBody body; char *buf; size_t buf_size; + struct MintKeyState *key_state; + struct TALER_MINT_DenomKeyIssue *dki; + struct TALER_Amount cost; + struct TALER_Amount total_cost; + struct TALER_Amount melt; + struct TALER_Amount total_melt; /* check that signature from the session public key is ok */ hash_context = GNUNET_CRYPTO_hash_context_start (); @@ -197,6 +203,45 @@ handle_refresh_melt_binary (struct MHD_Connection *connection, &body.purpose))) return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES; + // FIXME: badness, use proper way to set to zero... + key_state = TALER_MINT_key_state_acquire (); + memset (&total_cost, 0, sizeof (struct TALER_Amount)); + for (i=0;iissue; + cost = TALER_amount_add (TALER_amount_ntoh (dki->value), + TALER_amount_ntoh (dki->fee_withdraw)); + // FIXME: #3637 + total_cost = TALER_amount_add (cost, + total_cost); + } + + // FIXME: badness, use proper way to set to zero... + memset (&total_melt, 0, sizeof (struct TALER_Amount)); + for (i=0;i