summaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_do_reserve_purse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/pg_do_reserve_purse.c')
-rw-r--r--src/exchangedb/pg_do_reserve_purse.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/exchangedb/pg_do_reserve_purse.c b/src/exchangedb/pg_do_reserve_purse.c
index cb8f83d41..e03e23fec 100644
--- a/src/exchangedb/pg_do_reserve_purse.c
+++ b/src/exchangedb/pg_do_reserve_purse.c
@@ -57,15 +57,27 @@ TEH_PG_do_reserve_purse (
struct PostgresClosure *pg = cls;
struct TALER_Amount zero_fee;
struct TALER_PaytoHashP h_payto;
+ struct GNUNET_TIME_Timestamp reserve_expiration
+ = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
+ pg->idle_reserve_expiration_time));
+ struct GNUNET_TIME_Timestamp reserve_gc
+ = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
+ pg->legal_reserve_expiration_time));
+
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (purse_pub),
GNUNET_PQ_query_param_auto_from_type (merge_sig),
GNUNET_PQ_query_param_timestamp (&merge_timestamp),
+ GNUNET_PQ_query_param_timestamp (&reserve_expiration),
+ GNUNET_PQ_query_param_timestamp (&reserve_gc),
GNUNET_PQ_query_param_auto_from_type (reserve_sig),
GNUNET_PQ_query_param_bool (NULL == purse_fee),
- TALER_PQ_query_param_amount (NULL == purse_fee
- ? &zero_fee
- : purse_fee),
+ TALER_PQ_query_param_amount (pg->conn,
+ NULL == purse_fee
+ ? &zero_fee
+ : purse_fee),
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
GNUNET_PQ_query_param_auto_from_type (&h_payto),
GNUNET_PQ_query_param_end
@@ -100,7 +112,7 @@ TEH_PG_do_reserve_purse (
",out_no_reserve AS no_reserve"
",out_conflict AS conflict"
" FROM exchange_do_reserve_purse"
- " ($1, $2, $3, $4, $5, $6, $7, $8, $9);");
+ " ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);");
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"call_reserve_purse",