From cdd2930a9951a552d221b8a8b8e9c0df35ad8be2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 23 May 2022 14:57:00 +0200 Subject: -misc fixes to reserve history --- src/exchange/taler-exchange-httpd_reserves_status.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/exchange/taler-exchange-httpd_reserves_status.c') diff --git a/src/exchange/taler-exchange-httpd_reserves_status.c b/src/exchange/taler-exchange-httpd_reserves_status.c index 6a3260d1..69931e24 100644 --- a/src/exchange/taler-exchange-httpd_reserves_status.c +++ b/src/exchange/taler-exchange-httpd_reserves_status.c @@ -53,6 +53,11 @@ struct ReserveStatusContext */ struct TALER_EXCHANGEDB_ReserveHistory *rh; + /** + * Current KYC status. + */ + struct TALER_EXCHANGEDB_KycStatus kyc; + /** * Current reserve 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, -- cgit v1.2.3