From 53a7140a0bcfc47a373e6392e38e498f9b091f18 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 21 Jan 2015 13:38:57 +0100 Subject: move /refresh/reveal response generation to taler-mint-httpd_responses.c --- src/mint/taler-mint-httpd_responses.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/mint/taler-mint-httpd_responses.c') diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index 89d79b362..9ba855eea 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -362,6 +362,35 @@ TALER_MINT_reply_refresh_commit_success (struct MHD_Connection *connection, } +/** + * Send a response for "/refresh/reveal". + * + * @param connection the connection to send the response to + * @param num_newcoins number of new coins for which we reveal data + * @param sigs array of @a num_newcoins signatures revealed + * @return a MHD result code + */ +int +TALER_MINT_reply_refresh_reveal_success (struct MHD_Connection *connection, + unsigned int num_newcoins, + const struct TALER_RSA_Signature *sigs) +{ + int newcoin_index; + json_t *root; + json_t *list; + + root = json_object (); + list = json_array (); + json_object_set_new (root, "ev_sigs", list); + for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++) + json_array_append_new (list, + TALER_JSON_from_data (&sigs[newcoin_index], + sizeof (struct TALER_RSA_Signature))); + return TALER_MINT_reply_json (connection, + root, + MHD_HTTP_OK); + +} -- cgit v1.2.3