-improve logging

This commit is contained in:
Christian Grothoff 2021-11-20 09:42:25 +01:00
parent 2fed889224
commit 935c2d4e62
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -2206,27 +2206,16 @@ check_denomination (
const struct TALER_DenominationKeyValidityPS *issue = &validity->properties; const struct TALER_DenominationKeyValidityPS *issue = &validity->properties;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
struct TALER_AuditorSignatureP auditor_sig; struct TALER_AuditorSignatureP auditor_sig;
(void) cls;
(void) denom_pub;
qs = TALER_ARL_edb->select_auditor_denom_sig (TALER_ARL_edb->cls,
&issue->denom_hash,
&TALER_ARL_auditor_pub,
&auditor_sig);
if (0 >= qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Encountered denomination `%s' that this auditor is not auditing!\n",
GNUNET_h2s (&issue->denom_hash.hash));
return; /* skip! */
}
{
struct TALER_Amount coin_value; struct TALER_Amount coin_value;
struct TALER_Amount fee_withdraw; struct TALER_Amount fee_withdraw;
struct TALER_Amount fee_deposit; struct TALER_Amount fee_deposit;
struct TALER_Amount fee_refresh; struct TALER_Amount fee_refresh;
struct TALER_Amount fee_refund; struct TALER_Amount fee_refund;
struct GNUNET_TIME_Absolute start;
struct GNUNET_TIME_Absolute end;
(void) cls;
(void) denom_pub;
TALER_amount_ntoh (&coin_value, TALER_amount_ntoh (&coin_value,
&issue->value); &issue->value);
TALER_amount_ntoh (&fee_withdraw, TALER_amount_ntoh (&fee_withdraw,
@ -2237,15 +2226,32 @@ check_denomination (
&issue->fee_refresh); &issue->fee_refresh);
TALER_amount_ntoh (&fee_refund, TALER_amount_ntoh (&fee_refund,
&issue->fee_refund); &issue->fee_refund);
start = GNUNET_TIME_absolute_ntoh (issue->start);
end = GNUNET_TIME_absolute_ntoh (issue->expire_legal);
qs = TALER_ARL_edb->select_auditor_denom_sig (TALER_ARL_edb->cls,
&issue->denom_hash,
&TALER_ARL_auditor_pub,
&auditor_sig);
if (0 >= qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Encountered denomination `%s' (%s) valid from %s (%llu-%llu) that this auditor is not auditing!\n",
GNUNET_h2s (&issue->denom_hash.hash),
TALER_amount2s (&coin_value),
GNUNET_STRINGS_absolute_time_to_string (start),
(unsigned long long) start.abs_value_us,
(unsigned long long) end.abs_value_us);
return; /* skip! */
}
if (GNUNET_OK != if (GNUNET_OK !=
TALER_auditor_denom_validity_verify ( TALER_auditor_denom_validity_verify (
TALER_ARL_auditor_url, TALER_ARL_auditor_url,
&issue->denom_hash, &issue->denom_hash,
&TALER_ARL_master_pub, &TALER_ARL_master_pub,
GNUNET_TIME_absolute_ntoh (issue->start), start,
GNUNET_TIME_absolute_ntoh (issue->expire_withdraw), GNUNET_TIME_absolute_ntoh (issue->expire_withdraw),
GNUNET_TIME_absolute_ntoh (issue->expire_deposit), GNUNET_TIME_absolute_ntoh (issue->expire_deposit),
GNUNET_TIME_absolute_ntoh (issue->expire_legal), end,
&coin_value, &coin_value,
&fee_withdraw, &fee_withdraw,
&fee_deposit, &fee_deposit,
@ -2260,12 +2266,10 @@ check_denomination (
&issue->denom_hash), &issue->denom_hash),
TALER_JSON_pack_amount ("value", TALER_JSON_pack_amount ("value",
&coin_value), &coin_value),
TALER_JSON_pack_time_abs_nbo_human ("start_time", TALER_JSON_pack_time_abs_human ("start_time",
issue->start), start),
TALER_JSON_pack_time_abs_nbo_human ("end_time", TALER_JSON_pack_time_abs_human ("end_time",
issue-> end)));
expire_legal)));
}
} }
} }