diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-23 14:57:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-23 14:57:00 +0200 |
commit | cdd2930a9951a552d221b8a8b8e9c0df35ad8be2 (patch) | |
tree | 2389f0cad26e47d2315650f2f9e698120c5f2182 /src/exchange | |
parent | 2035294adbcafc93c70d2cb7d27ce1a74d5a61ca (diff) | |
download | exchange-cdd2930a9951a552d221b8a8b8e9c0df35ad8be2.tar.gz exchange-cdd2930a9951a552d221b8a8b8e9c0df35ad8be2.tar.bz2 exchange-cdd2930a9951a552d221b8a8b8e9c0df35ad8be2.zip |
-misc fixes to reserve history
Diffstat (limited to 'src/exchange')
-rw-r--r-- | src/exchange/taler-exchange-httpd_reserves_status.c | 21 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 2 |
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)); |