summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-11-29 21:15:47 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2023-11-29 21:15:47 +0100
commit6dc78a22b39a9a84bb7a3d46dccc3f7110e42a4b (patch)
tree8996aceaa9632332022405b85fb1542f6551d427
parentec01a6fac0499f5d424195ba9810114c6ec58d03 (diff)
downloadexchange-6dc78a22b39a9a84bb7a3d46dccc3f7110e42a4b.tar.gz
exchange-6dc78a22b39a9a84bb7a3d46dccc3f7110e42a4b.tar.bz2
exchange-6dc78a22b39a9a84bb7a3d46dccc3f7110e42a4b.zip
-less nested scope
-rw-r--r--src/exchange/taler-exchange-httpd_extensions.c65
1 files changed, 30 insertions, 35 deletions
diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c
index 1ee573b0f..dd0fada76 100644
--- a/src/exchange/taler-exchange-httpd_extensions.c
+++ b/src/exchange/taler-exchange-httpd_extensions.c
@@ -357,44 +357,39 @@ TEH_extensions_post_handler (
}
+ if (GNUNET_OK !=
+ ext->policy_post_handler (root,
+ &args[1],
+ policy_details,
+ policy_details_count,
+ &output))
{
- enum GNUNET_GenericReturnValue ret;
-
- ret = ext->policy_post_handler (root,
- &args[1],
- policy_details,
- policy_details_count,
- &output);
-
- if (GNUNET_OK != ret)
- {
- TALER_MHD_reply_json_steal (
- rc->connection,
- output,
- MHD_HTTP_BAD_REQUEST);
- }
+ return TALER_MHD_reply_json_steal (
+ rc->connection,
+ output,
+ MHD_HTTP_BAD_REQUEST);
+ }
- /* execute fulfillment transaction */
+ /* execute fulfillment transaction */
+ {
+ MHD_RESULT mhd_ret;
+ struct TALER_PolicyFulfillmentTransactionData fulfillment = {
+ .proof = root,
+ .timestamp = GNUNET_TIME_timestamp_get (),
+ .details = policy_details,
+ .details_count = policy_details_count
+ };
+
+ if (GNUNET_OK !=
+ TEH_DB_run_transaction (rc->connection,
+ "execute policy fulfillment",
+ TEH_MT_REQUEST_POLICY_FULFILLMENT,
+ &mhd_ret,
+ &policy_fulfillment_transaction,
+ &fulfillment))
{
- MHD_RESULT mhd_ret;
- struct TALER_PolicyFulfillmentTransactionData fulfillment = {
- .proof = root,
- .timestamp = GNUNET_TIME_timestamp_get (),
- .details = policy_details,
- .details_count = policy_details_count
- };
-
- if (GNUNET_OK !=
- TEH_DB_run_transaction (rc->connection,
- "execute policy fulfillment",
- TEH_MT_REQUEST_POLICY_FULFILLMENT,
- &mhd_ret,
- &policy_fulfillment_transaction,
- &fulfillment))
- {
- json_decref (output);
- return mhd_ret;
- }
+ json_decref (output);
+ return mhd_ret;
}
}