gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix 404 reserve issue - without


From: gnunet
Subject: [taler-exchange] branch master updated: fix 404 reserve issue - without duplicate KYC
Date: Wed, 23 Aug 2023 10:39:48 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 4a64d721 fix 404 reserve issue - without duplicate KYC
4a64d721 is described below

commit 4a64d7210a20f3b45ec62b604bd0d27c6fcc350a
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Aug 23 10:39:42 2023 +0200

    fix 404 reserve issue - without duplicate KYC
---
 src/exchange/taler-exchange-httpd_batch-withdraw.c | 76 ++++++++++------------
 1 file changed, 35 insertions(+), 41 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c 
b/src/exchange/taler-exchange-httpd_batch-withdraw.c
index f6d56f8c..38a7f43c 100644
--- a/src/exchange/taler-exchange-httpd_batch-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c
@@ -422,56 +422,50 @@ batch_withdraw_transaction (void *cls,
                                              "reserves_get_origin");
     return qs;
   }
-  if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+  /* If no results, reserve was created by merge, in which case no KYC check
+     is required as the merge already did that. */
+  if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
   {
-    /* Assume P2P transfer, so origin is reserve_pub */
-    char *pt;
-
-    pt = TALER_reserve_make_payto (TEH_base_url,
-                                   wc->reserve_pub);
-    TALER_payto_hash (pt,
-                      &wc->h_payto);
-    GNUNET_free (pt);
-  }
-  qs = TALER_KYCLOGIC_kyc_test_required (
-    TALER_KYCLOGIC_KYC_TRIGGER_WITHDRAW,
-    &wc->h_payto,
-    TEH_plugin->select_satisfied_kyc_processes,
-    TEH_plugin->cls,
-    &batch_withdraw_amount_cb,
-    wc,
-    &kyc_required);
-  if (qs < 0)
-  {
-    GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
-    if (GNUNET_DB_STATUS_HARD_ERROR == qs)
-      *mhd_ret = TALER_MHD_reply_with_error (connection,
-                                             MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                             TALER_EC_GENERIC_DB_FETCH_FAILED,
-                                             "kyc_test_required");
-    return qs;
-  }
-  if (NULL != kyc_required)
-  {
-    /* insert KYC requirement into DB! */
-    wc->kyc.ok = false;
-    qs = TEH_plugin->insert_kyc_requirement_for_account (
-      TEH_plugin->cls,
-      kyc_required,
+    qs = TALER_KYCLOGIC_kyc_test_required (
+      TALER_KYCLOGIC_KYC_TRIGGER_WITHDRAW,
       &wc->h_payto,
-      wc->reserve_pub,
-      &wc->kyc.requirement_row);
-    GNUNET_free (kyc_required);
+      TEH_plugin->select_satisfied_kyc_processes,
+      TEH_plugin->cls,
+      &batch_withdraw_amount_cb,
+      wc,
+      &kyc_required);
     if (qs < 0)
     {
       GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
       if (GNUNET_DB_STATUS_HARD_ERROR == qs)
         *mhd_ret = TALER_MHD_reply_with_error (connection,
                                                MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                               
TALER_EC_GENERIC_DB_STORE_FAILED,
-                                               
"insert_kyc_requirement_for_account");
+                                               
TALER_EC_GENERIC_DB_FETCH_FAILED,
+                                               "kyc_test_required");
+      return qs;
+    }
+    if (NULL != kyc_required)
+    {
+      /* insert KYC requirement into DB! */
+      wc->kyc.ok = false;
+      qs = TEH_plugin->insert_kyc_requirement_for_account (
+        TEH_plugin->cls,
+        kyc_required,
+        &wc->h_payto,
+        wc->reserve_pub,
+        &wc->kyc.requirement_row);
+      GNUNET_free (kyc_required);
+      if (qs < 0)
+      {
+        GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
+        if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+          *mhd_ret = TALER_MHD_reply_with_error (connection,
+                                                 
MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                                 
TALER_EC_GENERIC_DB_STORE_FAILED,
+                                                 
"insert_kyc_requirement_for_account");
+      }
+      return qs;
     }
-    return qs;
   }
   wc->kyc.ok = true;
 

-- 
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]