From e371d76cfe1b78cd373046ca6be535157e41793c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 May 2023 14:17:33 +0200 Subject: add KYC_AML_TRIGGER option (not implemented) --- src/exchange/taler-exchange-httpd.c | 16 ++++++++++++++++ src/exchange/taler-exchange-httpd.h | 5 +++++ src/util/conversion.c | 23 +++++++++++++---------- 3 files changed, 34 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 3a2c4c001..348967f77 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -153,6 +153,11 @@ struct TALER_EXCHANGEDB_Plugin *TEH_plugin; */ char *TEH_currency; +/** + * Name of the KYC-AML-trigger evaluation binary. + */ +char *TEH_kyc_aml_trigger; + /** * Option set to #GNUNET_YES if tipping is enabled. */ @@ -1849,6 +1854,17 @@ exchange_serve_process_config (void) "valid relative time expected"); return GNUNET_SYSERR; } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (TEH_cfg, + "exchange", + "KYC_AML_TRIGGER", + &TEH_kyc_aml_trigger)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "exchange", + "KYC_AML_TRIGGER"); + return GNUNET_SYSERR; + } if (GNUNET_OK != TALER_config_get_currency (TEH_cfg, &TEH_currency)) diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h index e06807b59..24e087721 100644 --- a/src/exchange/taler-exchange-httpd.h +++ b/src/exchange/taler-exchange-httpd.h @@ -102,6 +102,11 @@ extern struct TALER_EXCHANGEDB_Plugin *TEH_plugin; */ extern char *TEH_currency; +/** + * Name of the KYC-AML-trigger evaluation binary. + */ +extern char *TEH_kyc_aml_trigger; + /** * What is the largest amount we allow a peer to * merge into a reserve before always triggering diff --git a/src/util/conversion.c b/src/util/conversion.c index 501ca0145..fdeffba40 100644 --- a/src/util/conversion.c +++ b/src/util/conversion.c @@ -251,7 +251,7 @@ child_done_cb (void *cls, long unsigned int exit_code) { struct TALER_JSON_ExternalConversion *ec = cls; - json_t *j; + json_t *j = NULL; json_error_t err; ec->cwh = NULL; @@ -269,16 +269,19 @@ child_done_cb (void *cls, } GNUNET_OS_process_destroy (ec->helper); ec->helper = NULL; - j = json_loadb (ec->read_buf, - ec->read_pos, - JSON_REJECT_DUPLICATES, - &err); - if (NULL == j) + if (0 != ec->read_pos) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Failed to parse JSON from helper at %d: %s\n", - err.position, - err.text); + j = json_loadb (ec->read_buf, + ec->read_pos, + JSON_REJECT_DUPLICATES, + &err); + if (NULL == j) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Failed to parse JSON from helper at %d: %s\n", + err.position, + err.text); + } } ec->cb (ec->cb_cls, type, -- cgit v1.2.3