diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-05 14:42:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-05 14:42:50 +0200 |
commit | 70ba42e55ba5c68a54f5690728c9ece9d029fe6e (patch) | |
tree | 462793bf892e2a84e5bcc5e1571828c199942407 /src/backend/taler-merchant-httpd_pay.c | |
parent | d7eb23ad965c0207e561261588cbf742f93df935 (diff) | |
download | merchant-70ba42e55ba5c68a54f5690728c9ece9d029fe6e.tar.gz merchant-70ba42e55ba5c68a54f5690728c9ece9d029fe6e.tar.bz2 merchant-70ba42e55ba5c68a54f5690728c9ece9d029fe6e.zip |
check double spending proofs
Diffstat (limited to 'src/backend/taler-merchant-httpd_pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index f7830896..1c5b66bf 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -300,10 +300,19 @@ deposit_cb (void *cls, } else { - /* Forward error including 'proof' for the body */ + /* Forward error, adding the "coin_pub" for which the + error was being generated */ + json_t *eproof; + + eproof = json_copy ((json_t *) proof); + json_object_set (eproof, + "coin_pub", + GNUNET_JSON_from_data (&dc->coin_pub, + sizeof (struct TALER_CoinSpendPublicKeyP))); resume_pay_with_response (pc, http_status, - TMH_RESPONSE_make_json (proof)); + TMH_RESPONSE_make_json (eproof)); + json_decref (eproof); } return; } @@ -633,8 +642,6 @@ MH_handler_pay (struct TMH_RequestHandler *rh, GNUNET_break (0); return MHD_NO; /* hard error */ } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Queueing response for /pay.\n"); res = MHD_queue_response (connection, pc->response_code, pc->response); @@ -643,6 +650,10 @@ MH_handler_pay (struct TMH_RequestHandler *rh, MHD_destroy_response (pc->response); pc->response = NULL; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Queueing response (%u) for /pay (%s).\n", + (unsigned int) pc->response_code, + res ? "OK" : "FAILED"); return res; } |