gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 125/130: fix DB query and error handling


From: gnunet
Subject: [taler-exchange] 125/130: fix DB query and error handling
Date: Wed, 17 Nov 2021 12:26:13 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit ed1db63a48840c417fb49dc5f0711544d50faee6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Nov 17 11:01:19 2021 +0100

    fix DB query and error handling
---
 src/exchange/taler-exchange-httpd_kyc-proof.c | 15 ++++++++++++---
 src/exchangedb/plugin_exchangedb_postgres.c   |  6 +++++-
 src/testing/testing_api_cmd_exec_aggregator.c |  1 +
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c 
b/src/exchange/taler-exchange-httpd_kyc-proof.c
index 7bd9fdaa..6bd98abf 100644
--- a/src/exchange/taler-exchange-httpd_kyc-proof.c
+++ b/src/exchange/taler-exchange-httpd_kyc-proof.c
@@ -168,10 +168,19 @@ persist_kyc_ok (void *cls,
                 MHD_RESULT *mhd_ret)
 {
   struct KycProofContext *kpc = cls;
+  enum GNUNET_DB_QueryStatus qs;
 
-  return TEH_plugin->set_kyc_ok (TEH_plugin->cls,
-                                 kpc->payment_target_uuid,
-                                 kpc->id);
+  qs = TEH_plugin->set_kyc_ok (TEH_plugin->cls,
+                               kpc->payment_target_uuid,
+                               kpc->id);
+  if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+  {
+    GNUNET_break (0);
+    *mhd_ret = TALER_MHD_reply_with_ec (connection,
+                                        TALER_EC_GENERIC_DB_STORE_FAILED,
+                                        "set_kyc_ok");
+  }
+  return qs;
 }
 
 
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index a5066e88..9bfe777f 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -3810,6 +3810,10 @@ postgres_set_kyc_ok (void *cls,
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
+    GNUNET_PQ_query_param_uint64 (&payment_target_uuid),
+    GNUNET_PQ_query_param_end
+  };
+  struct GNUNET_PQ_QueryParam params2[] = {
     GNUNET_PQ_query_param_uint64 (&payment_target_uuid),
     GNUNET_PQ_query_param_string (id),
     GNUNET_PQ_query_param_end
@@ -3827,7 +3831,7 @@ postgres_set_kyc_ok (void *cls,
 
   qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                            "set_kyc_ok",
-                                           params);
+                                           params2);
   if (qs <= 0)
     return qs;
   qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
diff --git a/src/testing/testing_api_cmd_exec_aggregator.c 
b/src/testing/testing_api_cmd_exec_aggregator.c
index 1f05576f..0f3cc1e1 100644
--- a/src/testing/testing_api_cmd_exec_aggregator.c
+++ b/src/testing/testing_api_cmd_exec_aggregator.c
@@ -72,6 +72,7 @@ aggregator_run (void *cls,
                                "taler-exchange-aggregator",
                                "taler-exchange-aggregator",
                                "-c", as->config_filename,
+                               "-L", "INFO",
                                "-t", /* exit when done */
                                (as->kyc_on)
                                ? NULL

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]