[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: store AML program failure even i
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: store AML program failure even if AML program was not triggered via legi process but via expiration |
Date: |
Sun, 08 Dec 2024 16:18:48 +0100 |
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 2c3c5044f store AML program failure even if AML program was not
triggered via legi process but via expiration
2c3c5044f is described below
commit 2c3c5044fd428ffacfb3ae282bd6d851f1cc02a6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 8 16:18:45 2024 +0100
store AML program failure even if AML program was not triggered via legi
process but via expiration
---
src/exchangedb/exchangedb_aml.c | 2 +-
src/exchangedb/pg_insert_aml_program_failure.c | 36 +++++++++++---------------
src/exchangedb/procedures.sql.in | 1 +
src/include/taler_exchangedb_lib.h | 5 +++-
4 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/src/exchangedb/exchangedb_aml.c b/src/exchangedb/exchangedb_aml.c
index a7fcb69fe..10ab52a6d 100644
--- a/src/exchangedb/exchangedb_aml.c
+++ b/src/exchangedb/exchangedb_aml.c
@@ -254,7 +254,7 @@ aml_result_callback (
/* Update database update based on result */
qs = TALER_EXCHANGEDB_persist_aml_program_result (
ru->plugin,
- 0, // FIXME: process row NEEDED! - #9303 may give us something here!?
+ 0LLU, /* 0: no existing legitimization process, creates new row */
&ru->account,
apr);
switch (qs)
diff --git a/src/exchangedb/pg_insert_aml_program_failure.c
b/src/exchangedb/pg_insert_aml_program_failure.c
index 3429994d3..20880a91d 100644
--- a/src/exchangedb/pg_insert_aml_program_failure.c
+++ b/src/exchangedb/pg_insert_aml_program_failure.c
@@ -37,40 +37,34 @@ TEH_PG_insert_aml_program_failure (
{
struct PostgresClosure *pg = cls;
uint32_t ec32 = (uint32_t) ec;
+ struct TALER_KycCompletedEventP rep = {
+ .header.size = htons (sizeof (rep)),
+ .header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED),
+ .h_payto = *h_payto
+ };
+ struct GNUNET_TIME_Timestamp now
+ = GNUNET_TIME_timestamp_get ();
+ char *kyc_completed_notify_s
+ = GNUNET_PQ_get_event_notify_channel (&rep.header);
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&process_row),
GNUNET_PQ_query_param_auto_from_type (h_payto),
GNUNET_PQ_query_param_uint32 (&ec32),
+ GNUNET_PQ_query_param_timestamp (&now),
GNUNET_PQ_query_param_string (error_message),
+ GNUNET_PQ_query_param_string (kyc_completed_notify_s),
GNUNET_PQ_query_param_end
};
enum GNUNET_DB_QueryStatus qs;
PREPARE (pg,
"insert_aml_program_failure",
- "UPDATE legitimization_processes"
- " SET"
- " finished=TRUE"
- " ,error_code=$3"
- " ,error_message=$4"
- " WHERE h_payto=$2"
- " AND legitimization_process_serial_id=$1;");
+ "SELECT out_update"
+ " FROM exchange_do_insert_aml_program_failure"
+ " ($1, $2, $3, $4);");
qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
"insert_aml_program_failure",
params);
- if (qs > 0)
- {
- /* FIXME: might want to do this eventually in the same transaction... */
- struct TALER_KycCompletedEventP rep = {
- .header.size = htons (sizeof (rep)),
- .header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED),
- .h_payto = *h_payto
- };
-
- TEH_PG_event_notify (pg,
- &rep.header,
- NULL,
- 0);
- }
+ GNUNET_free (kyc_completed_notify_s);
return qs;
}
diff --git a/src/exchangedb/procedures.sql.in b/src/exchangedb/procedures.sql.in
index 02c422c03..038149275 100644
--- a/src/exchangedb/procedures.sql.in
+++ b/src/exchangedb/procedures.sql.in
@@ -57,5 +57,6 @@ SET search_path TO exchange;
#include "exchange_do_insert_active_legitimization_measure.sql"
#include "exchange_do_select_aggregations_above_serial.sql"
#include "exchange_do_persist_kyc_attributes.sql"
+#include "exchange_do_insert_aml_program_failure.sql"
COMMIT;
diff --git a/src/include/taler_exchangedb_lib.h
b/src/include/taler_exchangedb_lib.h
index e7fc86742..b72f313b6 100644
--- a/src/include/taler_exchangedb_lib.h
+++ b/src/include/taler_exchangedb_lib.h
@@ -365,7 +365,10 @@ TALER_EXCHANGEDB_update_rules_cancel (
* into the database via @a plugin.
*
* @param plugin database API handle
- * @param process_row row identifying the AML process that was run
+ * @param process_row row identifying the legitimization process that was run,
+ * 0 if there was no legi process (for example, due to rule
+ * expiration triggering something) and we should simply
+ * create a new row
* @param account_id hash of account the result is about
* @param apr AML program result to persist
*/
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: store AML program failure even if AML program was not triggered via legi process but via expiration,
gnunet <=