summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 2d5d8dce9..322da3877 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -181,31 +181,16 @@ MHD_RESULT
TEH_RESPONSE_reply_reserve_insufficient_balance (
struct MHD_Connection *connection,
enum TALER_ErrorCode ec,
+ const struct TALER_Amount *reserve_balance,
const struct TALER_Amount *balance_required,
const struct TALER_ReservePublicKeyP *reserve_pub)
{
- struct TALER_Amount balance;
- enum GNUNET_DB_QueryStatus qs;
-
- // FIXME: pass balance as argument to this function,
- // instead of getting it in another transaction!
- qs = TEH_plugin->get_reserve_balance (TEH_plugin->cls,
- reserve_pub,
- &balance);
- if (qs < 0)
- {
- GNUNET_break (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_FETCH_FAILED,
- "reserve balance");
- }
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_CONFLICT,
TALER_JSON_pack_ec (ec),
TALER_JSON_pack_amount ("balance",
- &balance),
+ reserve_balance),
TALER_JSON_pack_amount ("requested_amount",
balance_required));
}