diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-10-14 14:45:10 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-14 14:45:10 +0200 |
commit | 7d62fa065bba408860a79fe121a62ef8f515159c (patch) | |
tree | e03053b30346fb0c6e90ccef7f57c5d63ef8d174 /src/exchange/taler-exchange-httpd_withdraw.c | |
parent | 1b119edd6225567419add05e0a92170ebfa457df (diff) | |
download | exchange-7d62fa065bba408860a79fe121a62ef8f515159c.tar.gz exchange-7d62fa065bba408860a79fe121a62ef8f515159c.tar.bz2 exchange-7d62fa065bba408860a79fe121a62ef8f515159c.zip |
start with KYC support in DB
Diffstat (limited to 'src/exchange/taler-exchange-httpd_withdraw.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_withdraw.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c index d9cba045c..ca5618af6 100644 --- a/src/exchange/taler-exchange-httpd_withdraw.c +++ b/src/exchange/taler-exchange-httpd_withdraw.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2019 Taler Systems SA + Copyright (C) 2014-2021 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -165,6 +165,7 @@ withdraw_transaction (void *cls, struct TALER_EXCHANGEDB_Reserve r; enum GNUNET_DB_QueryStatus qs; struct TALER_DenominationSignature denom_sig; + struct TALER_EXCHANGEDB_KycStatus kyc; #if OPTIMISTIC_SIGN /* store away optimistic signature to protect @@ -209,7 +210,8 @@ withdraw_transaction (void *cls, "Trying to withdraw from reserve: %s\n", TALER_B2S (&r.pub)); qs = TEH_plugin->reserves_get (TEH_plugin->cls, - &r); + &r, + &kyc); if (0 > qs) { if (GNUNET_DB_STATUS_HARD_ERROR == qs) @@ -268,6 +270,13 @@ withdraw_transaction (void *cls, return GNUNET_DB_STATUS_HARD_ERROR; } + if ( (! kyc.ok) && + (TEH_KYC_NONE != TEH_kyc_config.mode) ) + { + // FIXME: check if we are above the limit + // for KYC, and if so, deny the transaction! + } + /* Balance is good, sign the coin! */ #if ! OPTIMISTIC_SIGN if (NULL == wc->collectable.sig.rsa_signature) |