summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_batch-withdraw.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-17 18:24:20 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-17 18:24:20 +0100
commitaa5e7d2ad5e712434f32ab41b63d53bb897c6105 (patch)
tree63eca83e563d69d5d689f4e9c3c218be0950e854 /src/exchange/taler-exchange-httpd_batch-withdraw.c
parent86e0f2c70d07c7c5e1656667bd818498ea55d0a4 (diff)
downloadexchange-aa5e7d2ad5e712434f32ab41b63d53bb897c6105.tar.gz
exchange-aa5e7d2ad5e712434f32ab41b63d53bb897c6105.tar.bz2
exchange-aa5e7d2ad5e712434f32ab41b63d53bb897c6105.zip
more towards actually allowing AML decisions to trigger KYC
Diffstat (limited to 'src/exchange/taler-exchange-httpd_batch-withdraw.c')
-rw-r--r--src/exchange/taler-exchange-httpd_batch-withdraw.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c b/src/exchange/taler-exchange-httpd_batch-withdraw.c
index e6be54a58..493a2bc70 100644
--- a/src/exchange/taler-exchange-httpd_batch-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c
@@ -210,7 +210,7 @@ batch_withdraw_transaction (void *cls,
enum GNUNET_DB_QueryStatus qs;
bool balance_ok = false;
bool found = false;
- const char *kyc_required;
+ char *kyc_required;
struct TALER_PaytoHashP reserve_h_payto;
wc->now = GNUNET_TIME_timestamp_get ();
@@ -349,11 +349,22 @@ batch_withdraw_transaction (void *cls,
{
/* insert KYC requirement into DB! */
wc->kyc.ok = false;
- return TEH_plugin->insert_kyc_requirement_for_account (
+ qs = TEH_plugin->insert_kyc_requirement_for_account (
TEH_plugin->cls,
kyc_required,
&wc->h_payto,
&wc->kyc.requirement_row);
+ GNUNET_free (kyc_required);
+ if (qs < 0)
+ {
+ GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
+ if (GNUNET_DB_STATUS_HARD_ERROR == qs)
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_STORE_FAILED,
+ "insert_kyc_requirement_for_account");
+ }
+ return qs;
}
wc->kyc.ok = true;
qs = TEH_plugin->do_batch_withdraw (TEH_plugin->cls,