aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_do_batch_withdraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/pg_do_batch_withdraw.c')
-rw-r--r--src/exchangedb/pg_do_batch_withdraw.c13
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,