summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-21 19:18:31 +0200
committerChristian Grothoff <christian@grothoff.org>2015-06-21 19:18:31 +0200
commit5caa52aa4cf7eb4e59cef34195f61d088a28a622 (patch)
treecaacee4443a52e4b23fd5e5f5fbb8d94701d31e4 /src/mint/taler-mint-httpd_deposit.c
parentc5641e9141ed8fccf13a2a11cb859e93e8270974 (diff)
downloadexchange-5caa52aa4cf7eb4e59cef34195f61d088a28a622.tar.gz
exchange-5caa52aa4cf7eb4e59cef34195f61d088a28a622.tar.bz2
exchange-5caa52aa4cf7eb4e59cef34195f61d088a28a622.zip
implementing /deposit JSON generation
Diffstat (limited to 'src/mint/taler-mint-httpd_deposit.c')
-rw-r--r--src/mint/taler-mint-httpd_deposit.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c
index 2e9facdff..53187dcb0 100644
--- a/src/mint/taler-mint-httpd_deposit.c
+++ b/src/mint/taler-mint-httpd_deposit.c
@@ -136,8 +136,6 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
{
int res;
struct TALER_MINTDB_Deposit deposit;
- char *wire_enc;
- size_t len;
struct TALER_MINTDB_DenominationKeyIssueInformation *dki;
struct TMH_KS_StateHandle *ks;
struct TMH_PARSE_FieldSpecification spec[] = {
@@ -170,18 +168,15 @@ parse_and_handle_deposit_request (struct MHD_Connection *connection,
return TMH_RESPONSE_reply_arg_unknown (connection,
"wire");
}
- if (NULL == (wire_enc = json_dumps (wire, JSON_COMPACT | JSON_SORT_KEYS)))
+ if (GNUNET_OK !=
+ TALER_hash_json (wire,
+ &deposit.h_wire))
{
TALER_LOG_WARNING ("Failed to parse JSON wire format specification for /deposit request\n");
TMH_PARSE_release_data (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
"wire");
}
- len = strlen (wire_enc) + 1;
- GNUNET_CRYPTO_hash (wire_enc,
- len,
- &deposit.h_wire);
- GNUNET_free (wire_enc);
ks = TMH_KS_acquire ();
dki = TMH_KS_denomination_key_lookup (ks,
&deposit.coin.denom_pub,