summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_withdraw.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-17 01:45:07 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-17 01:45:07 +0100
commit067719a3c9a96feeb533d5bd28d586fa31e43dcb (patch)
tree1ebc7165e227a34a6915a6cd1be21becdff57a7b /src/exchange/taler-exchange-httpd_withdraw.c
parentc597af8334c34f2e6c9e8a693af80f86eb8e0cc1 (diff)
downloadexchange-067719a3c9a96feeb533d5bd28d586fa31e43dcb.tar.gz
exchange-067719a3c9a96feeb533d5bd28d586fa31e43dcb.tar.bz2
exchange-067719a3c9a96feeb533d5bd28d586fa31e43dcb.zip
code cleanup, more consistent handling of libjansson allocation failures
Diffstat (limited to 'src/exchange/taler-exchange-httpd_withdraw.c')
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c
index 4575a8ab5..5665f24fb 100644
--- a/src/exchange/taler-exchange-httpd_withdraw.c
+++ b/src/exchange/taler-exchange-httpd_withdraw.c
@@ -92,33 +92,6 @@ reply_withdraw_insufficient_funds (
/**
- * Send blind signature to client.
- *
- * @param connection connection to the client
- * @param collectable blinded coin to return
- * @return MHD result code
- */
-static int
-reply_withdraw_success (
- struct MHD_Connection *connection,
- const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
-{
- json_t *sig_json;
-
- sig_json = GNUNET_JSON_from_rsa_signature (collectable->sig.rsa_signature);
- if (NULL == sig_json)
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_JSON_ALLOCATION_FAILURE,
- "GNUNET_JSON_from_rsa_signature() failed");
- return TALER_MHD_reply_json_pack (connection,
- MHD_HTTP_OK,
- "{s:o}",
- "ev_sig", sig_json);
-}
-
-
-/**
* Context for #withdraw_transaction.
*/
struct WithdrawContext
@@ -540,8 +513,12 @@ TEH_handler_withdraw (const struct TEH_RequestHandler *rh,
{
int ret;
- ret = reply_withdraw_success (connection,
- &wc.collectable);
+ ret = TALER_MHD_reply_json_pack (
+ connection,
+ MHD_HTTP_OK,
+ "{s:o}",
+ "ev_sig", GNUNET_JSON_from_rsa_signature (
+ wc.collectable.sig.rsa_signature));
GNUNET_CRYPTO_rsa_signature_free (wc.collectable.sig.rsa_signature);
return ret;
}