[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: fix incorrect setting of bad_kyc
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: fix incorrect setting of bad_kyc_auth |
Date: |
Wed, 11 Sep 2024 22:51:16 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new b3c5db363 fix incorrect setting of bad_kyc_auth
b3c5db363 is described below
commit b3c5db363adea7434bc87737f930f053e03d868e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Sep 11 22:51:12 2024 +0200
fix incorrect setting of bad_kyc_auth
---
src/exchange/taler-exchange-httpd_common_kyc.c | 13 +++++++++++++
.../exchange_do_trigger_kyc_rule_for_account.sql | 20 ++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c
b/src/exchange/taler-exchange-httpd_common_kyc.c
index d54b40529..c28dbb601 100644
--- a/src/exchange/taler-exchange-httpd_common_kyc.c
+++ b/src/exchange/taler-exchange-httpd_common_kyc.c
@@ -1515,6 +1515,12 @@ run_check (
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "trigger_kyc_rule_for_account on %d/%d returned %llu/%d\n",
+ lch->have_account_pub,
+ lch->have_merchant_pub,
+ (unsigned long long) lch->lcr.kyc.requirement_row,
+ lch->lcr.bad_kyc_auth);
/* return success! */
lch->async_task
= GNUNET_SCHEDULER_add_now (
@@ -1839,6 +1845,13 @@ legitimization_check_run (
TALER_KYCLOGIC_rule2priority (requirement),
&lch->lcr.kyc.requirement_row,
&lch->lcr.bad_kyc_auth);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "trigger_kyc_rule_for_account on %d/%d returned %d/%llu/%d\n",
+ lch->have_account_pub,
+ lch->have_merchant_pub,
+ (int) qs,
+ (unsigned long long) lch->lcr.kyc.requirement_row,
+ lch->lcr.bad_kyc_auth);
json_decref (jmeasures);
}
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
diff --git a/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
b/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
index 4ddf57952..414ac51ff 100644
--- a/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
+++ b/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
@@ -33,10 +33,12 @@ DECLARE
my_rec RECORD;
my_access_token BYTEA;
my_account_pub BYTEA;
+ my_reserve_pub BYTEA;
BEGIN
-- Note: in_payto_uri is allowed to be NULL *if*
-- in_h_payto is already in wire_targets
+
SELECT
access_token
,target_pub
@@ -68,6 +70,24 @@ ELSE
out_bad_kyc_auth=TRUE;
END IF;
+IF out_bad_kyc_auth
+THEN
+ -- Check most recent reserve_in wire transfer, we also
+ -- allow that reserve public key for authentication!
+ SELECT reserve_pub
+ INTO my_reserve_pub
+ FROM reserves_in
+ WHERE wire_source_h_payto=in_h_payto
+ ORDER BY execution_date DESC
+ LIMIT 1;
+ IF FOUND
+ THEN
+ IF in_merchant_pub = my_reserve_pub
+ THEN
+ out_bad_kyc_auth = FALSE;
+ END IF;
+ END IF;
+END IF;
-- First check if a perfectly equivalent legi measure
-- already exists, to avoid creating tons of duplicates.
UPDATE legitimization_measures
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: fix incorrect setting of bad_kyc_auth,
gnunet <=