commit 4e83739451cc56b514ab56e426627b151a2fb1c6
parent 7456ab2b9c925801aab70c53e530105ef28c540d
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 5 May 2025 21:01:25 +0200
fix #9861
Diffstat:
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -431,7 +431,8 @@ TEH_handler_kyc_check (
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "KYC rules apply:\n");
+ "KYC rules apply to %s:\n",
+ is_wallet ? "wallet" : "account");
if (NULL != jrules)
json_dumpf (jrules,
stderr,
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
@@ -1011,14 +1011,17 @@ TALER_KYCLOGIC_rules_to_limits (const json_t *jrules,
}
{
+ const json_t *rules;
json_t *limits;
json_t *limit;
json_t *rule;
size_t idx;
+ rules = json_object_get (jrules,
+ "rules");
limits = json_array ();
GNUNET_assert (NULL != limits);
- json_array_foreach ((json_t *) jrules, idx, rule)
+ json_array_foreach ((json_t *) rules, idx, rule)
{
struct GNUNET_TIME_Relative timeframe;
struct TALER_Amount threshold;
@@ -1051,7 +1054,7 @@ TALER_KYCLOGIC_rules_to_limits (const json_t *jrules,
json_t *jmeasure;
if (GNUNET_OK !=
- GNUNET_JSON_parse (jrules,
+ GNUNET_JSON_parse (rule,
spec,
NULL, NULL))
{
@@ -1063,7 +1066,16 @@ TALER_KYCLOGIC_rules_to_limits (const json_t *jrules,
continue;
if (! trigger_applies (operation_type,
is_wallet))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Skipping rule #%u that does not apply to %s\n",
+ (unsigned int) idx,
+ is_wallet ? "wallets" : "accounts");
+ json_dumpf (rule,
+ stderr,
+ JSON_INDENT (2));
continue;
+ }
json_array_foreach (jmeasures, i, jmeasure)
{
const char *val;