summaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-23 12:48:07 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-23 12:48:07 +0200
commitd189fccd790a36046e1191d7170f45feb3dfb122 (patch)
treee1bb8b8d25be3e9245eabadb057c496a714947c7 /src/exchangedb/pg_lookup_kyc_requirement_by_row.c
parenta56a903da3ec46b4c1d1109cc40c2dc149be956b (diff)
downloadexchange-d189fccd790a36046e1191d7170f45feb3dfb122.tar.gz
exchange-d189fccd790a36046e1191d7170f45feb3dfb122.tar.bz2
exchange-d189fccd790a36046e1191d7170f45feb3dfb122.zip
Added reserve_pub to kyc legitimization_processes
Where applicable, the reserve_pub will be passed on to the kcy-legitimization process and persisted along with h_payto. This allows us to set a birthday on the reserve itself, once a related kyc-process has provided one.
Diffstat (limited to 'src/exchangedb/pg_lookup_kyc_requirement_by_row.c')
-rw-r--r--src/exchangedb/pg_lookup_kyc_requirement_by_row.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
index 6f9d76786..a167c0458 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
@@ -31,7 +31,8 @@ TEH_PG_lookup_kyc_requirement_by_row (
uint64_t requirement_row,
char **requirements,
enum TALER_AmlDecisionState *aml_status,
- struct TALER_PaytoHashP *h_payto)
+ struct TALER_PaytoHashP *h_payto,
+ struct TALER_ReservePublicKeyP **reserve_pub)
{
struct PostgresClosure *pg = cls;
uint32_t status = TALER_AML_NORMAL;
@@ -39,12 +40,19 @@ TEH_PG_lookup_kyc_requirement_by_row (
GNUNET_PQ_query_param_uint64 (&requirement_row),
GNUNET_PQ_query_param_end
};
+ bool no_reserve_pub;
+ struct TALER_ReservePublicKeyP *rp =
+ GNUNET_new (struct TALER_ReservePublicKeyP);
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_string ("required_checks",
requirements),
GNUNET_PQ_result_spec_auto_from_type ("h_payto",
h_payto),
GNUNET_PQ_result_spec_allow_null (
+ GNUNET_PQ_result_spec_auto_from_type ("reserve_pub",
+ rp),
+ &no_reserve_pub),
+ GNUNET_PQ_result_spec_allow_null (
GNUNET_PQ_result_spec_uint32 ("status",
&status),
NULL),
@@ -57,6 +65,7 @@ TEH_PG_lookup_kyc_requirement_by_row (
"SELECT "
" lr.required_checks"
",lr.h_payto"
+ ",lr.reserve_pub"
",aml.status"
" FROM legitimization_requirements lr"
" LEFT JOIN aml_status aml USING (h_payto)"
@@ -67,5 +76,11 @@ TEH_PG_lookup_kyc_requirement_by_row (
params,
rs);
*aml_status = (enum TALER_AmlDecisionState) status;
+ if (no_reserve_pub)
+ {
+ GNUNET_free (rp);
+ rp = NULL;
+ }
+ *reserve_pub = rp;
return qs;
}