aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_select_aml_threshold.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-19 10:21:29 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-19 10:21:29 +0100
commit06e2e8022c01f2a2866eb79ed38552ef5ac2a6b2 (patch)
treebec032926469f5506d9051a9b1efa10066921ab7 /src/exchangedb/pg_select_aml_threshold.c
parentaa5e7d2ad5e712434f32ab41b63d53bb897c6105 (diff)
downloadexchange-06e2e8022c01f2a2866eb79ed38552ef5ac2a6b2.tar.xz
return KYC requirement row when AML imposed KYC requirements on withdraw; return KYC choices in new /config endpoint
Diffstat (limited to 'src/exchangedb/pg_select_aml_threshold.c')
-rw-r--r--src/exchangedb/pg_select_aml_threshold.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/exchangedb/pg_select_aml_threshold.c b/src/exchangedb/pg_select_aml_threshold.c
index e67a57a39..7a79b70c1 100644
--- a/src/exchangedb/pg_select_aml_threshold.c
+++ b/src/exchangedb/pg_select_aml_threshold.c
@@ -31,6 +31,7 @@ TEH_PG_select_aml_threshold (
void *cls,
const struct TALER_PaytoHashP *h_payto,
enum TALER_AmlDecisionState *decision,
+ struct TALER_EXCHANGEDB_KycStatus *kyc,
struct TALER_Amount *threshold)
{
struct PostgresClosure *pg = cls;
@@ -44,6 +45,8 @@ TEH_PG_select_aml_threshold (
threshold),
GNUNET_PQ_result_spec_uint32 ("status",
&status32),
+ GNUNET_PQ_result_spec_uint64 ("kyc_requirement",
+ &kyc->requirement_row),
GNUNET_PQ_result_spec_end
};
enum GNUNET_DB_QueryStatus qs;
@@ -53,6 +56,7 @@ TEH_PG_select_aml_threshold (
"SELECT"
" threshold_val"
",threshold_frac"
+ ",kyc_requirement"
" FROM aml_status"
" WHERE h_payto=$1;");
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
@@ -60,5 +64,7 @@ TEH_PG_select_aml_threshold (
params,
rs);
*decision = (enum TALER_AmlDecisionState) status32;
+ kyc->ok = (TALER_AML_FROZEN != *decision)
+ || (0 != kyc->requirement_row);
return qs;
}