aboutsummaryrefslogtreecommitdiff
path: root/src/kyclogic
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-17 18:24:20 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-17 18:24:20 +0100
commitaa5e7d2ad5e712434f32ab41b63d53bb897c6105 (patch)
tree63eca83e563d69d5d689f4e9c3c218be0950e854 /src/kyclogic
parent86e0f2c70d07c7c5e1656667bd818498ea55d0a4 (diff)
more towards actually allowing AML decisions to trigger KYC
Diffstat (limited to 'src/kyclogic')
-rw-r--r--src/kyclogic/kyclogic_api.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
index e1aff0204..9f35743cd 100644
--- a/src/kyclogic/kyclogic_api.c
+++ b/src/kyclogic/kyclogic_api.c
@@ -1228,7 +1228,7 @@ TALER_KYCLOGIC_kyc_get_details (
enum GNUNET_DB_QueryStatus
-TALER_KYCLOGIC_check_satisfied (const char *requirements,
+TALER_KYCLOGIC_check_satisfied (char **requirements,
const struct TALER_PaytoHashP *h_payto,
json_t **kyc_details,
TALER_KYCLOGIC_KycSatisfiedIterator ki,
@@ -1244,13 +1244,14 @@ TALER_KYCLOGIC_check_satisfied (const char *requirements,
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
}
{
- char *req = GNUNET_strdup (requirements);
+ char *req = *requirements;
for (const char *tok = strtok (req, " ");
NULL != tok;
tok = strtok (NULL, " "))
needed[needed_cnt++] = add_check (tok);
GNUNET_free (req);
+ *requirements = NULL;
}
{
@@ -1286,6 +1287,32 @@ TALER_KYCLOGIC_check_satisfied (const char *requirements,
}
}
*satisfied = (0 == needed_cnt);
+
+ {
+ char *res = NULL;
+
+ for (unsigned int i = 0; i<needed_cnt; i++)
+ {
+ const struct TALER_KYCLOGIC_KycCheck *need = needed[i];
+
+ if (NULL == res)
+ {
+ res = GNUNET_strdup (need->name);
+ }
+ else
+ {
+ char *tmp;
+
+ GNUNET_asprintf (&tmp,
+ "%s %s",
+ res,
+ need->name);
+ GNUNET_free (res);
+ res = tmp;
+ }
+ }
+ *requirements = res;
+ }
return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
}