commit 7f02630773be1c122c5b1f252a032ce965524802
parent db3c135e9676e0cdd6b85becb0071e3fba14db69
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 12 Apr 2025 23:02:43 +0200
more logging in taler-mechant-kyccheck, disable slow start when running in test mode
Diffstat:
1 file changed, 43 insertions(+), 6 deletions(-)
diff --git a/src/backend/taler-merchant-kyccheck.c b/src/backend/taler-merchant-kyccheck.c
@@ -666,6 +666,13 @@ inquiry_work (void *cls)
i->task = NULL;
if (! GNUNET_TIME_absolute_is_past (i->due))
{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Will start inquiry on %s for %s in %s\n",
+ i->a->merchant_account_uri.full_payto,
+ i->e->keys->exchange_url,
+ GNUNET_TIME_relative2s (
+ GNUNET_TIME_absolute_get_remaining (i->due),
+ true));
i->task
= GNUNET_SCHEDULER_add_at (i->due,
&inquiry_work,
@@ -804,15 +811,27 @@ start_inquiry (struct Exchange *e,
so let's check, but slowly within the next minute
so that we do not overdo it if this process happens
to be restarted a lot. */
- i->due = GNUNET_TIME_relative_to_absolute (
- GNUNET_TIME_randomize (GNUNET_TIME_UNIT_MINUTES));
+ if (GNUNET_YES != test_mode)
+ {
+ i->due = GNUNET_TIME_relative_to_absolute (
+ GNUNET_TIME_randomize (GNUNET_TIME_UNIT_MINUTES));
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Previous KYC status is OK, randomizing inquiry to start at %s\n",
+ GNUNET_TIME_absolute2s (i->due));
+ }
break;
case MHD_HTTP_ACCEPTED:
/* KYC required, due immediately */
break;
case MHD_HTTP_NO_CONTENT:
/* KYC is OFF, only check again if triggered */
- i->due = GNUNET_TIME_relative_to_absolute (AML_LOW_FREQ);
+ if (GNUNET_YES != test_mode)
+ {
+ i->due = GNUNET_TIME_relative_to_absolute (AML_LOW_FREQ);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "KYC was disabled, randomizing inquiry to start at %s\n",
+ GNUNET_TIME_absolute2s (i->due));
+ }
break;
case MHD_HTTP_FORBIDDEN: /* bad signature */
case MHD_HTTP_NOT_FOUND: /* account unknown */
@@ -821,8 +840,15 @@ start_inquiry (struct Exchange *e,
break;
default:
/* start with decent back-off after hard failure */
- i->backoff
- = GNUNET_TIME_randomize (GNUNET_TIME_UNIT_MINUTES);
+ if (GNUNET_YES != test_mode)
+ {
+ i->backoff
+ = GNUNET_TIME_randomize (GNUNET_TIME_UNIT_MINUTES);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Last KYC check failed, starting with backoff %s\n",
+ GNUNET_TIME_relative2s (i->backoff,
+ true));
+ }
break;
}
inquiry_work (i);
@@ -897,10 +923,17 @@ start_inquiries (struct Account *a)
for (struct Exchange *e = e_head;
NULL != e;
e = e->next)
+ {
if (is_eligible (e->keys,
a))
start_inquiry (e,
a);
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Account %s not eligible at exchange %s\n",
+ a->merchant_account_uri.full_payto,
+ e->keys->exchange_url);
+ }
}
@@ -964,7 +997,11 @@ account_cb (
= *merchant_priv;
TALER_full_payto_normalize_and_hash (a->merchant_account_uri,
&a->h_payto);
-
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Found account %s of instance %s with H_PAYTO %s\n",
+ ad->payto_uri.full_payto,
+ ad->instance_id,
+ GNUNET_sh2s (&a->h_payto.hash));
GNUNET_CONTAINER_DLL_insert (a_head,
a_tail,
a);