commit 47ecd9d1e74de23eeac06f5429433d52b0ab18d4
parent 780e0606b73b9457ed48c0dbb385d9d08746f346
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 25 Feb 2026 21:16:04 +0100
add tons of logging
Diffstat:
4 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -251,6 +251,14 @@ TEH_handler_kyc_check (
TALER_HTTP_HEADER_ACCOUNT_OWNER_PUBKEY,
&kyp->account_pub,
kyp->have_pub);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Looking for KYCAUTH transfer for account %s\n",
+ TALER_B2S (&kyp->h_payto));
+ if (kyp->have_pub)
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Looking for KYCAUTH transfer for public key %s\n",
+ TALER_B2S (&kyp->account_pub));
+
TALER_MHD_parse_request_timeout (rc->connection,
&kyp->timeout);
{
diff --git a/src/exchangedb/exchange_do_kycauth_in_insert.sql b/src/exchangedb/exchange_do_kycauth_in_insert.sql
@@ -32,6 +32,8 @@ DECLARE
my_is_wallet BOOL;
BEGIN
+ RAISE WARNING 'Adding KYCAUTH-IN with pub % ', in_account_pub;
+ RAISE WARNING 'Adding KYCAUTH-IN from % ', in_h_normalized_payto;
INSERT INTO kycauths_in
(account_pub
,wire_reference
@@ -75,6 +77,7 @@ BEGIN
in_h_normalized_payto
,my_is_wallet
,in_account_pub);
+ RAISE WARNING 'Added new KYC TARGET for %: %', in_account_pub, FOUND;
INSERT INTO wire_targets
(wire_target_h_payto
,h_normalized_payto
diff --git a/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql b/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql
@@ -37,6 +37,8 @@ DECLARE
my_ok BOOL;
BEGIN
+RAISE WARNING 'LOOKING UP kyc_target for %', in_h_normalized_payto;
+
-- Find the access token and the current account public key.
SELECT access_token
,target_pub
@@ -47,7 +49,7 @@ SELECT access_token
IF NOT FOUND
THEN
- -- RAISE WARNING 'kyc_target % not found', in_h_normalized_payto;
+ RAISE WARNING 'kyc_target % not found', in_h_normalized_payto;
-- Given that we don't recognize the normalized payto, there is no
-- chance that we can match the incoming public key against anything,
-- so this is a 404-case.
@@ -56,28 +58,52 @@ THEN
RETURN;
END IF;
+RAISE WARNING 'CHECK: % %=%s', in_account_pub IS NOT NULL, my_wtrec.target_pub, in_account_pub;
+
+-- It is definitively OK if we were given a public key AND it matches
my_ok = (in_account_pub IS NOT NULL) AND
(my_wtrec.target_pub = in_account_pub);
IF ( (NOT my_ok) AND
(in_account_pub IS NOT NULL) )
THEN
- -- RAISE WARNING 'target_pub % does not match', in_account_pub;
+ RAISE WARNING 'target_pub % does not match', in_account_pub;
-- We were given an in_account_pub, but it did not match the
-- target pub.
-- Try to see if the in_account_pub appears in ANY reserve_in
- -- for this account instead.
+ -- or kyc_auths_in for this account instead.
PERFORM
- FROM reserves_in
- WHERE reserve_pub=in_account_pub
- AND wire_source_h_payto IN
- (SELECT wire_target_h_payto
- FROM wire_targets
- WHERE h_normalized_payto=in_h_normalized_payto);
+ FROM reserves_in ri
+ JOIN wire_targets wt
+ ON (ri.wire_source_h_payto = wt.wire_target_h_payto)
+ WHERE ri.reserve_pub=in_account_pub
+ AND wt.h_normalized_payto=in_h_normalized_payto;
IF FOUND
THEN
my_wtrec.target_pub = in_account_pub;
my_ok = TRUE;
+ RAISE WARNING 'target_pub DID match regular wire transfer';
+ ELSE
+ PERFORM
+ FROM kycauths_in ki
+ JOIN wire_targets wt
+ ON (ki.wire_source_h_payto = wt.wire_target_h_payto)
+ WHERE ki.account_pub=in_account_pub
+ AND wt.h_normalized_payto=in_h_normalized_payto;
+ IF FOUND
+ THEN
+ my_wtrec.target_pub = in_account_pub;
+ my_ok = TRUE;
+ RAISE WARNING 'target_pub DID match KYC AUTH transfer';
+ ELSE
+ RAISE WARNING 'target_pub does not match incoming transfer from %', in_h_normalized_payto;
+
+ PERFORM
+ FROM kycauths_in
+ WHERE account_pub=in_account_pub;
+ RAISE WARNING 'target_pub does not match ANY incoming transfer: %', FOUND;
+
+ END IF;
END IF;
END IF;
@@ -85,6 +111,7 @@ IF (NOT my_ok AND
( (in_account_pub IS NOT NULL) OR
(my_wtrec.target_pub IS NULL) ) )
THEN
+ RAISE WARNING 'No match and target_pub is NOT NULL';
-- We failed to find a matching public key for in_account_pub, and
-- either the client provided a specific one to match OR
-- we could not return any one that could even work, which means
diff --git a/src/exchangedb/pg_kycauth_in_insert.c b/src/exchangedb/pg_kycauth_in_insert.c
@@ -44,6 +44,12 @@ TEH_PG_kycauth_in_insert (
&h_full_payto);
TALER_full_payto_normalize_and_hash (debit_account_uri,
&h_normalized_payto);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Adding KYCAUTH transfer for account %s\n",
+ TALER_B2S (&h_normalized_payto));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Adding KYCAUTH transfer for public key %s\n",
+ TALER_B2S (account_pub));
{
struct TALER_KycCompletedEventP rep = {
.header.size = htons (sizeof (rep)),