summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_reserves_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserves_open.c')
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_open.c b/src/exchange/taler-exchange-httpd_reserves_open.c
index 6909c862a..5aadc9e40 100644
--- a/src/exchange/taler-exchange-httpd_reserves_open.c
+++ b/src/exchange/taler-exchange-httpd_reserves_open.c
@@ -188,6 +188,7 @@ reserve_open_transaction (void *cls,
{
struct ReserveOpenContext *rsc = cls;
enum GNUNET_DB_QueryStatus qs;
+ struct TALER_Amount reserve_balance;
for (unsigned int i = 0; i<rsc->payments_len; i++)
{
@@ -258,6 +259,7 @@ reserve_open_transaction (void *cls,
&rsc->gf->fees.account,
/* outputs */
&rsc->no_funds,
+ &reserve_balance,
&rsc->open_cost,
&rsc->reserve_expiration);
switch (qs)
@@ -289,6 +291,7 @@ reserve_open_transaction (void *cls,
= TEH_RESPONSE_reply_reserve_insufficient_balance (
connection,
TALER_EC_EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS,
+ &reserve_balance,
&rsc->reserve_payment,
rsc->reserve_pub);
return GNUNET_DB_STATUS_HARD_ERROR;
@@ -303,7 +306,7 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
const json_t *root)
{
struct ReserveOpenContext rsc;
- json_t *payments;
+ const json_t *payments;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_timestamp ("request_timestamp",
&rsc.timestamp),
@@ -313,8 +316,8 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
&rsc.reserve_sig),
GNUNET_JSON_spec_uint32 ("purse_limit",
&rsc.purse_limit),
- GNUNET_JSON_spec_json ("payments",
- &payments),
+ GNUNET_JSON_spec_array_const ("payments",
+ &payments),
TALER_JSON_spec_amount ("reserve_payment",
TEH_currency,
&rsc.reserve_payment),
@@ -403,7 +406,6 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
if (NULL == keys)
{
GNUNET_break (0);
- GNUNET_JSON_parse_free (spec);
cleanup_rsc (&rsc);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,