exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 4d22b01dd79434c94301e71697a1d5c9ab5a8d6d
parent 9ab71001bec6b8e2c8af9e2d13f00ea2ac2dcbda
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 26 Feb 2026 18:02:18 +0100

if KLPT is not set, use rule generation to determine when to suspend, plus add missing notification (fixes #11152)

Diffstat:
Msrc/exchange/taler-exchange-httpd_kyc-check.c | 6++++--
Msrc/exchangedb/exchangedb_aml.c | 19+++++++++++++++++++
Msrc/exchangedb/pg_insert_aml_decision.c | 3+++
Msrc/exchangedb/pg_insert_sanction_list_hit.c | 2++
4 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c @@ -151,7 +151,7 @@ kyp_cleanup (struct TEH_RequestContext *rc) if (NULL != kyp->eh) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Cancelling DB event listening\n"); + "Cancelling DB event listening (KYP cleanup)\n"); TEH_plugin->event_listen_cancel (TEH_plugin->cls, kyp->eh); kyp->eh = NULL; @@ -291,7 +291,7 @@ TEH_handler_kyc_check ( }; GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Starting DB event listening\n"); + "Starting DB event listening for KYC COMPLETED\n"); kyp->eh = TEH_plugin->event_listen ( TEH_plugin->cls, GNUNET_TIME_absolute_get_remaining (kyp->timeout), @@ -377,6 +377,8 @@ TEH_handler_kyc_check ( switch (kyp->lpt) { case TALER_EXCHANGE_KLPT_NONE: + /* If KLPT is not given, just go for rule generation */ + do_suspend = true; break; case TALER_EXCHANGE_KLPT_KYC_AUTH_TRANSFER: if (! access_ok) diff --git a/src/exchangedb/exchangedb_aml.c b/src/exchangedb/exchangedb_aml.c @@ -563,6 +563,8 @@ run_measure (struct TALER_EXCHANGEDB_RuleUpdater *ru, struct GNUNET_TIME_Timestamp last_date; enum GNUNET_DB_QueryStatus qs; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Inserting LEGI OUTCOME as successor measure\n"); qs = ru->plugin->insert_successor_measure ( ru->plugin->cls, &ru->account, @@ -591,6 +593,23 @@ run_measure (struct TALER_EXCHANGEDB_RuleUpdater *ru, default: break; } + + // FIXME: combine with above transaction... + { + struct TALER_KycCompletedEventP eh = { + .header.size = htons (sizeof (eh)), + .header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED), + .h_payto = ru->account + }; + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Triggering KYC COMPLETED event\n"); + ru->plugin->event_notify (ru->plugin->cls, + &eh.header, + NULL, + 0); + } + if (unknown_account) { fail_update (ru, diff --git a/src/exchangedb/pg_insert_aml_decision.c b/src/exchangedb/pg_insert_aml_decision.c @@ -169,6 +169,9 @@ TEH_PG_insert_aml_decision ( " FROM exchange_do_insert_aml_decision" "($1,$2,$3,$4,$5,$6::TEXT::JSONB,$7,$8,$9,$10::TEXT::JSONB" ",$11,$12,$13::TEXT::JSONB,$14,$15,$16,$17,$18,$19);"); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Inserting LEGI OUTCOME from AML decision with notification on %s\n", + notify_s); qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "do_insert_aml_decision", params, diff --git a/src/exchangedb/pg_insert_sanction_list_hit.c b/src/exchangedb/pg_insert_sanction_list_hit.c @@ -79,6 +79,8 @@ TEH_PG_insert_sanction_list_hit ( " out_outcome_serial_id AS outcome_serial_id" " FROM exchange_do_insert_sanction_list_hit" "($1,$2,$3,$4::TEXT::JSONB,$5::TEXT::JSONB,$6,$7,$8);"); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Inserting LEGI OUTCOME from sanction list hit\n"); qs = GNUNET_PQ_eval_prepared_singleton_select ( pg->conn, "do_insert_sanction_list_hit",