aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_reserves_open.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-12 22:16:40 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-12 22:16:40 +0200
commit4702b156dc8130a842745035c936de8817c7c700 (patch)
treef1c2d6c9013d2fa904c82b6cbc2b1effb9c6e16a /src/exchange/taler-exchange-httpd_reserves_open.c
parent3b34acdb72cd450974a3bbde6169f1bf9644a302 (diff)
-work on reserve control tests
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserves_open.c')
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_open.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_open.c b/src/exchange/taler-exchange-httpd_reserves_open.c
index 6ad2592f..ced291d7 100644
--- a/src/exchange/taler-exchange-httpd_reserves_open.c
+++ b/src/exchange/taler-exchange-httpd_reserves_open.c
@@ -108,6 +108,7 @@ struct ReserveOpenContext
* for the operation.
*/
bool no_funds;
+
};
@@ -122,6 +123,8 @@ static MHD_RESULT
reply_reserve_open_success (struct MHD_Connection *connection,
const struct ReserveOpenContext *rsc)
{
+ struct GNUNET_TIME_Timestamp now;
+ struct GNUNET_TIME_Timestamp re;
unsigned int status;
status = MHD_HTTP_OK;
@@ -129,11 +132,18 @@ reply_reserve_open_success (struct MHD_Connection *connection,
<,
rsc->desired_expiration))
status = MHD_HTTP_PAYMENT_REQUIRED;
+ now = GNUNET_TIME_timestamp_get ();
+ if (GNUNET_TIME_timestamp_cmp (rsc->reserve_expiration,
+ <,
+ now))
+ re = now;
+ else
+ re = rsc->reserve_expiration;
return TALER_MHD_REPLY_JSON_PACK (
connection,
status,
GNUNET_JSON_pack_timestamp ("reserve_expiration",
- rsc->reserve_expiration),
+ re),
TALER_JSON_pack_amount ("open_cost",
&rsc->open_cost));
}
@@ -234,7 +244,8 @@ reserve_open_transaction (void *cls,
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Do reserve open\n");
+ "Do reserve open with reserve payment of %s\n",
+ TALER_amount2s (&rsc->total));
qs = TEH_plugin->do_reserve_open (TEH_plugin->cls,
/* inputs */
rsc->reserve_pub,