summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_contract.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_contract.c')
-rw-r--r--src/backend/taler-merchant-httpd_contract.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/backend/taler-merchant-httpd_contract.c b/src/backend/taler-merchant-httpd_contract.c
index 9d159583..1f55ada9 100644
--- a/src/backend/taler-merchant-httpd_contract.c
+++ b/src/backend/taler-merchant-httpd_contract.c
@@ -187,29 +187,6 @@ MH_handler_contract (struct TMH_RequestHandler *rh,
"products in contract request malformed");
}
- /* Check if this transaction ID erroneously corresponds to a
- contract that already paid, in which case we should refuse
- to sign it again (frontend buggy, it should use a fresh
- transaction ID each time)! */
- if (GNUNET_OK ==
- db->check_payment (db->cls,
- transaction_id))
- {
- struct MHD_Response *resp;
- int ret;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Transaction %llu already paid in the past, refusing to sign!\n",
- (unsigned long long) transaction_id);
- resp = MHD_create_response_from_buffer (strlen ("Duplicate transaction ID!"),
- "Duplicate transaction ID!",
- MHD_RESPMEM_PERSISTENT);
- ret = MHD_queue_response (connection,
- MHD_HTTP_FORBIDDEN,
- resp);
- MHD_destroy_response (resp);
- return ret;
- }
/* add fields to the contract that the backend should provide */
json_object_set (jcontract,
@@ -220,12 +197,10 @@ MH_handler_contract (struct TMH_RequestHandler *rh,
j_auditors);
json_object_set_new (jcontract,
"H_wire",
- GNUNET_JSON_from_data (&h_wire,
- sizeof (h_wire)));
+ GNUNET_JSON_from_data_auto (&h_wire));
json_object_set_new (jcontract,
"merchant_pub",
- GNUNET_JSON_from_data (&pubkey,
- sizeof (pubkey)));
+ GNUNET_JSON_from_data_auto (&pubkey));
/* create contract signature */
contract.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_CONTRACT);
@@ -247,10 +222,8 @@ MH_handler_contract (struct TMH_RequestHandler *rh,
MHD_HTTP_OK,
"{s:O, s:O, s:O}",
"contract", jcontract,
- "merchant_sig", GNUNET_JSON_from_data (&contract_sig,
- sizeof (contract_sig)),
- "H_contract", GNUNET_JSON_from_data (&contract.h_contract,
- sizeof (contract.h_contract)));
+ "merchant_sig", GNUNET_JSON_from_data_auto (&contract_sig),
+ "H_contract", GNUNET_JSON_from_data_auto (&contract.h_contract));
GNUNET_JSON_parse_free (spec);
json_decref (root);
return res;