diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-06-26 00:01:31 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-06-26 00:01:31 +0200 |
commit | ddedf03a816e5139b235a3ebdf5b600508c5ed5f (patch) | |
tree | a65179048fc764ec82ddf645a8982186b0157448 /src/exchangedb/pg_do_batch_withdraw.c | |
parent | 70bfe0ed1b9a5dbb6cc487465ef3c3df4cdb0436 (diff) | |
download | exchange-ddedf03a816e5139b235a3ebdf5b600508c5ed5f.tar.xz |
[age-withdraw] age-withdraw commit- and reveal-handlers implemented, 12/n
The handlers for the commit- and reveal-phases of the age-withdraw
HTTP-endpoints are implemented, yet not active.
Still missing:
- support for age-withdraw is missing in lib/.
- tests
Diffstat (limited to 'src/exchangedb/pg_do_batch_withdraw.c')
-rw-r--r-- | src/exchangedb/pg_do_batch_withdraw.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/exchangedb/pg_do_batch_withdraw.c b/src/exchangedb/pg_do_batch_withdraw.c index d93caa15e..6b5816733 100644 --- a/src/exchangedb/pg_do_batch_withdraw.c +++ b/src/exchangedb/pg_do_batch_withdraw.c @@ -17,6 +17,7 @@ * @file exchangedb/pg_do_batch_withdraw.c * @brief Implementation of the do_batch_withdraw function for Postgres * @author Christian Grothoff + * @author Özgür Kesim */ #include "platform.h" #include "taler_error_codes.h" @@ -31,10 +32,12 @@ TEH_PG_do_batch_withdraw ( void *cls, struct GNUNET_TIME_Timestamp now, const struct TALER_ReservePublicKeyP *reserve_pub, - /* TODO[oec]: add parameter for maximum age and [out]parameter for required age */ const struct TALER_Amount *amount, + bool do_age_check, bool *found, bool *balance_ok, + bool *age_ok, + uint16_t *allowed_maximum_age, uint64_t *ruuid) { struct PostgresClosure *pg = cls; @@ -42,6 +45,7 @@ TEH_PG_do_batch_withdraw ( struct GNUNET_PQ_QueryParam params[] = { TALER_PQ_query_param_amount (amount), GNUNET_PQ_query_param_auto_from_type (reserve_pub), + GNUNET_PQ_query_param_bool (do_age_check), GNUNET_PQ_query_param_timestamp (&now), GNUNET_PQ_query_param_timestamp (&gc), GNUNET_PQ_query_param_end @@ -51,6 +55,10 @@ TEH_PG_do_batch_withdraw ( found), GNUNET_PQ_result_spec_bool ("balance_ok", balance_ok), + GNUNET_PQ_result_spec_bool ("age_ok", + age_ok), + GNUNET_PQ_result_spec_uint16 ("allowed_maximum_age", + allowed_maximum_age), GNUNET_PQ_result_spec_uint64 ("ruuid", ruuid), GNUNET_PQ_result_spec_end @@ -68,8 +76,9 @@ TEH_PG_do_batch_withdraw ( "SELECT " " reserve_found" ",balance_ok" + ",age_ok" + ",required_age" ",ruuid" - /* TODO[oec]: add parameter for maximum age and [out] parameter for required age */ " FROM exchange_do_batch_withdraw" " ($1,$2,$3,$4,$5);"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, |