summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_status.c21
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_status.c b/src/exchange/taler-exchange-httpd_reserves_status.c
index 6a3260d12..69931e242 100644
--- a/src/exchange/taler-exchange-httpd_reserves_status.c
+++ b/src/exchange/taler-exchange-httpd_reserves_status.c
@@ -54,6 +54,11 @@ struct ReserveStatusContext
struct TALER_EXCHANGEDB_ReserveHistory *rh;
/**
+ * Current KYC status.
+ */
+ struct TALER_EXCHANGEDB_KycStatus kyc;
+
+ /**
* Current reserve balance.
*/
struct TALER_Amount balance;
@@ -85,6 +90,8 @@ reply_reserve_status_success (struct MHD_Connection *connection,
MHD_HTTP_OK,
TALER_JSON_pack_amount ("balance",
&rhc->balance),
+ GNUNET_JSON_pack_bool ("kyc_passed",
+ rhc->kyc.ok),
GNUNET_JSON_pack_array_steal ("history",
json_history));
}
@@ -114,6 +121,20 @@ reserve_status_transaction (void *cls,
struct ReserveStatusContext *rsc = cls;
enum GNUNET_DB_QueryStatus qs;
+ qs = TEH_plugin->inselect_wallet_kyc_status (TEH_plugin->cls,
+ rsc->reserve_pub,
+ &rsc->kyc);
+ if (qs < 0)
+ {
+ if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
+ return qs;
+ GNUNET_break (0);
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_FETCH_FAILED,
+ "inselect_wallet_status");
+ return qs;
+ }
qs = TEH_plugin->get_reserve_history (TEH_plugin->cls,
rsc->reserve_pub,
&rsc->balance,
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 46499f55c..b52f0b88e 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -741,7 +741,7 @@ TEH_RESPONSE_compile_reserve_history (
pos->details.merge;
struct TALER_Amount amount;
- GNUNET_assert (0 >=
+ GNUNET_assert (0 <=
TALER_amount_subtract (&amount,
&merge->amount_with_fee,
&merge->purse_fee));