exchange

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

commit 581c632dabab6f59142e17d26133c2eef4c6c50f
parent 6ea8613f63163522a73d0775a1b686a8e72d6b2c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  8 Jun 2025 11:00:10 +0200

robocop sanction list entries do not come with expiration time (work on #9053)

Diffstat:
Msrc/exchange/taler-exchange-sanctionscheck.c | 3---
Msrc/exchangedb/pg_insert_sanction_list_hit.c | 5+++--
Msrc/exchangedb/pg_insert_sanction_list_hit.h | 2--
Msrc/include/taler_exchangedb_plugin.h | 2--
Msrc/include/taler_kyclogic_lib.h | 2--
Msrc/kyclogic/kyclogic_sanctions.c | 10++--------
6 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/src/exchange/taler-exchange-sanctionscheck.c b/src/exchange/taler-exchange-sanctionscheck.c @@ -270,7 +270,6 @@ begin_transaction (void); * @param cls closure * @param ec error code, #TALER_EC_NONE on success * @param best_match identifies the sanction list entry with the best match - * @param expires when does the sanction list entry expire * @param rating likelihood of the match, from 0 (none) to 1 (perfect) * @param confidence confidence in the evaluation, from 0 (none) to 1 (perfect) */ @@ -278,7 +277,6 @@ static void sanction_cb (void *cls, enum TALER_ErrorCode ec, const char *best_match, - struct GNUNET_TIME_Timestamp expires, double rating, double confidence) { @@ -330,7 +328,6 @@ sanction_cb (void *cls, investigate, new_rules, properties, - expires, 1, events); json_decref (properties); diff --git a/src/exchangedb/pg_insert_sanction_list_hit.c b/src/exchangedb/pg_insert_sanction_list_hit.c @@ -33,11 +33,12 @@ TEH_PG_insert_sanction_list_hit ( bool to_investigate, const json_t *new_rules, const json_t *account_properties, - struct GNUNET_TIME_Timestamp expiration_time, unsigned int num_events, const char **events) { struct PostgresClosure *pg = cls; + struct GNUNET_TIME_Timestamp never + = GNUNET_TIME_UNIT_FOREVER_TS; struct GNUNET_TIME_Timestamp now = GNUNET_TIME_timestamp_get (); struct TALER_KycCompletedEventP rep = { @@ -50,7 +51,7 @@ TEH_PG_insert_sanction_list_hit ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (h_payto), GNUNET_PQ_query_param_timestamp (&now), - GNUNET_PQ_query_param_timestamp (&expiration_time), + GNUNET_PQ_query_param_timestamp (&never), NULL != account_properties ? TALER_PQ_query_param_json (account_properties) : GNUNET_PQ_query_param_null (), diff --git a/src/exchangedb/pg_insert_sanction_list_hit.h b/src/exchangedb/pg_insert_sanction_list_hit.h @@ -36,7 +36,6 @@ * @param new_rules new KYC rules to apply to the account, NULL to preserve * existing rules * @param account_properties new account properties - * @param expiration_time when does the sanction list entry expire? * @param num_events length of the @a events array * @param events array of KYC events to trigger * @return database transaction status @@ -48,7 +47,6 @@ TEH_PG_insert_sanction_list_hit ( bool to_investigate, const json_t *new_rules, const json_t *account_properties, - struct GNUNET_TIME_Timestamp expiration_time, unsigned int num_events, const char **events); diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h @@ -7432,7 +7432,6 @@ struct TALER_EXCHANGEDB_Plugin * @param new_rules new KYC rules to apply to the account, NULL to preserve * existing rules * @param account_properties new account properties - * @param expiration_time when does the sanction list entry expire? * @param num_events length of the @a events array * @param events array of KYC events to trigger * @return database transaction status @@ -7444,7 +7443,6 @@ struct TALER_EXCHANGEDB_Plugin bool to_investigate, const json_t *new_rules, const json_t *account_properties, - struct GNUNET_TIME_Timestamp expiration_time, unsigned int num_events, const char **events); diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h @@ -1083,7 +1083,6 @@ struct TALER_KYCLOGIC_SanctionRater; * @param cls closure * @param ec error code, #TALER_EC_NONE on success * @param best_match identifies the sanction list entry with the best match - * @param expiration_time when does the sanction list entry expire * @param rating likelihood of the match, from 0 (none) to 1 (perfect) * @param confidence confidence in the evaluation, from 0 (none) to 1 (perfect) */ @@ -1092,7 +1091,6 @@ typedef void void *cls, enum TALER_ErrorCode ec, const char *best_match, - struct GNUNET_TIME_Timestamp expiration_time, double rating, double confidence); diff --git a/src/kyclogic/kyclogic_sanctions.c b/src/kyclogic/kyclogic_sanctions.c @@ -165,7 +165,6 @@ fail_hard (struct TALER_KYCLOGIC_SanctionRater *sr) ee->cb (ee->cb_cls, TALER_EC_EXCHANGE_GENERIC_KYC_SANCTION_LIST_CHECK_FAILED, NULL, - GNUNET_TIME_UNIT_ZERO_TS, 1.0, 0.0); free (ee->write_buf); @@ -199,7 +198,6 @@ process_buffer (struct TALER_KYCLOGIC_SanctionRater *sr) char *nl; double rating; double confidence; - unsigned long long expire; char best_match[1024]; size_t line_len; @@ -209,12 +207,11 @@ process_buffer (struct TALER_KYCLOGIC_SanctionRater *sr) GNUNET_assert (NULL != nl); *nl = '\0'; line_len = nl - buf; - if (4 != + if (3 != sscanf (buf, - "%lf %lf %llu %1023s", + "%lf %lf %1023s", &rating, &confidence, - &expire, best_match)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -232,9 +229,6 @@ process_buffer (struct TALER_KYCLOGIC_SanctionRater *sr) ee->cb (ee->cb_cls, TALER_EC_NONE, best_match, - 0 == expire - ? GNUNET_TIME_UNIT_FOREVER_TS - : GNUNET_TIME_timestamp_from_s (expire), rating, confidence); free (ee->write_buf);