gnunet-svn
[Top][All Lists]
Advanced

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

[exchange] branch master updated: work on #9053: implement DB notificati


From: Admin
Subject: [exchange] branch master updated: work on #9053: implement DB notification, minor bugfixes
Date: Thu, 05 Jun 2025 10:04:29 +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 d49d125e6 work on #9053: implement DB notification, minor bugfixes
d49d125e6 is described below

commit d49d125e629057bcfd5c2dbd3f42d1bf6e17a85c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jun 5 10:04:16 2025 +0200

    work on #9053: implement DB notification, minor bugfixes
---
 src/exchange/taler-exchange-sanctionscheck.c       | 27 ++++++++++++++--------
 src/exchangedb/exchange_do_insert_aml_decision.sql |  3 +++
 .../exchange_do_persist_kyc_attributes.sql         |  4 ++++
 src/kyclogic/kyclogic_sanctions.c                  |  1 -
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/exchange/taler-exchange-sanctionscheck.c 
b/src/exchange/taler-exchange-sanctionscheck.c
index 405808c73..22fb8674f 100644
--- a/src/exchange/taler-exchange-sanctionscheck.c
+++ b/src/exchange/taler-exchange-sanctionscheck.c
@@ -177,15 +177,21 @@ static void
 sync_row (void)
 {
   uint64_t r = GNUNET_htonll (min_row_id);
+  ssize_t rval;
 
   GNUNET_break (-1 != min_row_fd);
   GNUNET_break (0 == lseek (min_row_fd,
                             0,
                             SEEK_SET));
-  GNUNET_break (sizeof (r) ==
-                write (min_row_fd,
-                       &r,
-                       sizeof (r)));
+  rval = write (min_row_fd,
+                &r,
+                sizeof (r));
+  if (rval != (ssize_t) sizeof (r))
+  {
+    GNUNET_break (-1 == rval);
+    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
+                         "write");
+  }
   GNUNET_break (0 ==
                 fsync (min_row_fd));
 }
@@ -541,7 +547,8 @@ begin_transaction ()
   if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
   {
     db_plugin->rollback (db_plugin->cls);
-    GNUNET_SCHEDULER_shutdown ();
+    if (testmode)
+      GNUNET_SCHEDULER_shutdown ();
     return;
   }
   if (NULL == acc_head)
@@ -684,10 +691,10 @@ run (void *cls,
     uint64_t r;
 
     if (GNUNET_OK !=
-        GNUNET_CONFIGURATION_get_value_string (cfg,
-                                               "exchange-sanctionscheck",
-                                               "MIN_ROW_FILENAME",
-                                               &min_row_fn))
+        GNUNET_CONFIGURATION_get_value_filename (cfg,
+                                                 "exchange-sanctionscheck",
+                                                 "MIN_ROW_FILENAME",
+                                                 &min_row_fn))
     {
       GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                  "exchange-sanctionscheck",
@@ -707,7 +714,7 @@ run (void *cls,
       return;
     }
     min_row_fd = open (min_row_fn,
-                       O_CREAT,
+                       O_CREAT | O_RDWR,
                        S_IRUSR | S_IWUSR);
     if (-1 == min_row_fd)
     {
diff --git a/src/exchangedb/exchange_do_insert_aml_decision.sql 
b/src/exchangedb/exchange_do_insert_aml_decision.sql
index d59b08c41..cdc52d428 100644
--- a/src/exchangedb/exchange_do_insert_aml_decision.sql
+++ b/src/exchangedb/exchange_do_insert_aml_decision.sql
@@ -264,6 +264,9 @@ THEN
     )
     RETURNING kyc_attributes_serial_id
     INTO my_kyc_attributes_serial_id;
+  -- Wake up taler-exchange-sanctionscheck to check new attributes
+  -- This is value for TALER_DBEVENT_EXCHANGE_NEW_KYC_ATTRIBUTES.
+  NOTIFY XSX9Z5XGWWYFKXTAYCES63B62527JKNX9XD0131Z08THVV8YW5BZG;
 END IF;
 
 IF in_decider_pub IS NOT NULL
diff --git a/src/exchangedb/exchange_do_persist_kyc_attributes.sql 
b/src/exchangedb/exchange_do_persist_kyc_attributes.sql
index 37b68fc78..433369f4b 100644
--- a/src/exchangedb/exchange_do_persist_kyc_attributes.sql
+++ b/src/exchangedb/exchange_do_persist_kyc_attributes.sql
@@ -50,6 +50,10 @@ INSERT INTO kyc_attributes
   ,in_enc_attributes
   ,in_process_row);
 
+-- Wake up taler-exchange-sanctionscheck to check new attributes
+-- This is value for TALER_DBEVENT_EXCHANGE_NEW_KYC_ATTRIBUTES.
+NOTIFY XSX9Z5XGWWYFKXTAYCES63B62527JKNX9XD0131Z08THVV8YW5BZG;
+
 UPDATE legitimization_processes
   SET provider_user_id=in_provider_account_id
      ,provider_legitimization_id=in_provider_legitimization_id
diff --git a/src/kyclogic/kyclogic_sanctions.c 
b/src/kyclogic/kyclogic_sanctions.c
index 985a97cda..dfc94b63b 100644
--- a/src/kyclogic/kyclogic_sanctions.c
+++ b/src/kyclogic/kyclogic_sanctions.c
@@ -321,7 +321,6 @@ read_cb (void *cls)
     if (0 == ret)
     {
       /* regular end of stream, odd! */
-      GNUNET_break (0);
       fail_hard (sr);
       return;
     }

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