From d189fccd790a36046e1191d7170f45feb3dfb122 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 23 Jul 2023 12:48:07 +0200 Subject: 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. --- src/exchangedb/pg_lookup_kyc_requirement_by_row.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/exchangedb/pg_lookup_kyc_requirement_by_row.c') 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,11 +40,18 @@ 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), @@ -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; } -- cgit v1.2.3