diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-14 17:37:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-14 17:37:53 +0200 |
commit | 6e5092d83473dc1b0200d82744cf0f0056b0c110 (patch) | |
tree | 3a402d87e500fd4e85efb2ec19dfae6d942d9265 /src/exchangedb/pg_select_batch_deposits_missing_wire.c | |
parent | 1d088120a5c378ec5fe2d9cfd86353f9b75220c4 (diff) | |
download | exchange-6e5092d83473dc1b0200d82744cf0f0056b0c110.tar.xz |
more work towards auditor support for AML/KYC
Diffstat (limited to 'src/exchangedb/pg_select_batch_deposits_missing_wire.c')
-rw-r--r-- | src/exchangedb/pg_select_batch_deposits_missing_wire.c | 65 |
1 files changed, 22 insertions, 43 deletions
diff --git a/src/exchangedb/pg_select_batch_deposits_missing_wire.c b/src/exchangedb/pg_select_batch_deposits_missing_wire.c index 25b532ad6..1ab0a4b3b 100644 --- a/src/exchangedb/pg_select_batch_deposits_missing_wire.c +++ b/src/exchangedb/pg_select_batch_deposits_missing_wire.c @@ -69,34 +69,19 @@ missing_wire_cb (void *cls, while (0 < num_results) { - struct TALER_Amount total_amount; - struct TALER_Amount aml_limit; - char *payto_uri = NULL; - char *kyc_pending = NULL; - uint32_t aml_status32 = TALER_AML_NORMAL; + uint64_t batch_deposit_serial_id; struct GNUNET_TIME_Timestamp deadline; - bool no_aml_limit; + struct TALER_PaytoHashP wire_target_h_payto; + struct TALER_Amount total_amount; struct GNUNET_PQ_ResultSpec rs[] = { - TALER_PQ_RESULT_SPEC_AMOUNT ("total_amount_with_fee", - &total_amount), - GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_string ("payto_uri", - &payto_uri), - NULL), - GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_string ("kyc_pending", - &kyc_pending), - NULL), - GNUNET_PQ_result_spec_timestamp ("wire_deadline", + GNUNET_PQ_result_spec_uint64 ("batch_deposit_serial_id", + &batch_deposit_serial_id), + GNUNET_PQ_result_spec_auto_from_type ("wire_target_h_payto", + &wire_target_h_payto), + GNUNET_PQ_result_spec_timestamp ("deadline", &deadline), - GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_uint32 ("aml_status", - &aml_status32), - NULL), - GNUNET_PQ_result_spec_allow_null ( - TALER_PQ_RESULT_SPEC_AMOUNT ("aml_limit", - &aml_limit), - &no_aml_limit), + TALER_PQ_RESULT_SPEC_AMOUNT ("total_amount", + &total_amount), GNUNET_PQ_result_spec_end }; @@ -110,12 +95,10 @@ missing_wire_cb (void *cls, return; } mwc->cb (mwc->cb_cls, + batch_deposit_serial_id, &total_amount, - payto_uri, - deadline, - kyc_pending, - (enum TALER_AmlDecisionState) aml_status32, - no_aml_limit ? NULL : &aml_limit); + &wire_target_h_payto, + deadline); GNUNET_PQ_cleanup_result (rs); } } @@ -124,15 +107,13 @@ missing_wire_cb (void *cls, enum GNUNET_DB_QueryStatus TEH_PG_select_batch_deposits_missing_wire ( void *cls, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, + uint64_t min_batch_deposit_serial_id, TALER_EXCHANGEDB_WireMissingCallback cb, void *cb_cls) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_timestamp (&start_date), - GNUNET_PQ_query_param_timestamp (&end_date), + GNUNET_PQ_query_param_uint64 (&min_batch_deposit_serial_id), GNUNET_PQ_query_param_end }; struct MissingWireContext mwc = { @@ -144,18 +125,16 @@ TEH_PG_select_batch_deposits_missing_wire ( enum GNUNET_DB_QueryStatus qs; PREPARE (pg, - "deposits_get_overdue", + "deposits_get_deposits_missing_wire", "SELECT" - " total_amount_with_fee" - ",payto_uri" - ",kyc_pending" - ",wire_deadline" - ",aml_status" - ",aml_limit" + " batch_deposit_serial_id" + ",wire_target_h_payto" + ",deadline" + ",total_amount" " FROM exchange_do_select_deposits_missing_wire" - " ($1,$2);"); + " ($1);"); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - "deposits_get_overdue", + "deposits_get_deposits_missing_wire", params, &missing_wire_cb, &mwc); |