diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-16 15:45:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-16 15:45:35 +0100 |
commit | 6596e6c72362d3cbc6b383feb22b3a99717dbf66 (patch) | |
tree | bfc267c758b672682dc9cd08f2423d275e59eabb /src/exchangedb/pg_do_reserve_purse.c | |
parent | 402ca17600d57e2a3569771eb57881c42d5db0e4 (diff) | |
download | exchange-6596e6c72362d3cbc6b383feb22b3a99717dbf66.tar.xz |
fix for foreign key constraint problem for free purses on purse creation from reserve
Diffstat (limited to 'src/exchangedb/pg_do_reserve_purse.c')
-rw-r--r-- | src/exchangedb/pg_do_reserve_purse.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/exchangedb/pg_do_reserve_purse.c b/src/exchangedb/pg_do_reserve_purse.c index cb8f83d41..e8d3b7f1c 100644 --- a/src/exchangedb/pg_do_reserve_purse.c +++ b/src/exchangedb/pg_do_reserve_purse.c @@ -57,10 +57,21 @@ 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 |