commit c9fcf19af29a9428d1521471a0acffe8b25390e5
parent dae29a7e4ba3e6d8a16d5822ed68e4ab674b5bce
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 27 May 2025 14:33:20 +0200
DCE: removing dead tiny_amount variable, improving comments
Diffstat:
1 file changed, 16 insertions(+), 29 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c
@@ -215,11 +215,6 @@ static struct WireAccount *wa_tail;
static TALER_ARL_DEF_PP (wire_reserve_close_id);
/**
- * Amount that is considered "tiny"
- */
-static struct TALER_Amount tiny_amount;
-
-/**
* Total amount that was transferred too much from the exchange.
*/
static TALER_ARL_DEF_AB (total_bad_amount_out_plus);
@@ -291,7 +286,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
* Entry in map with wire information we expect to obtain from the
* #TALER_ARL_edb later.
*/
-struct ReserveOutInfo
+struct WireTransferOutInfo
{
/**
@@ -312,7 +307,7 @@ struct ReserveOutInfo
*
* @param cls NULL
* @param key unused key
- * @param value the `struct ReserveOutInfo` to free
+ * @param value the `struct WireTransferOutInfo` to free
* @return #GNUNET_OK
*/
static enum GNUNET_GenericReturnValue
@@ -320,7 +315,7 @@ free_roi (void *cls,
const struct GNUNET_HashCode *key,
void *value)
{
- struct ReserveOutInfo *roi = value;
+ struct WireTransferOutInfo *roi = value;
(void) cls;
GNUNET_assert (GNUNET_YES ==
@@ -694,7 +689,7 @@ struct CheckMatchContext
/**
* Reserve operation looking for a match
*/
- const struct ReserveOutInfo *roi;
+ const struct WireTransferOutInfo *roi;
/**
* Set to true if we found a match.
@@ -783,7 +778,7 @@ make_missing_diag (char diag[MAX_DIAG_LEN],
* #GNUNET_SYSERR on database trouble
*/
static enum GNUNET_GenericReturnValue
-check_reported_inconsistency (struct ReserveOutInfo *roi)
+check_reported_inconsistency (struct WireTransferOutInfo *roi)
{
char diag[MAX_DIAG_LEN];
struct TALER_AUDITORDB_WireOutInconsistency woi = {
@@ -832,7 +827,7 @@ check_reported_inconsistency (struct ReserveOutInfo *roi)
* #GNUNET_SYSERR on database trouble
*/
static enum GNUNET_GenericReturnValue
-check_profit_drain (struct ReserveOutInfo *roi)
+check_profit_drain (struct WireTransferOutInfo *roi)
{
enum GNUNET_DB_QueryStatus qs;
uint64_t serial;
@@ -981,7 +976,7 @@ check_profit_drain (struct ReserveOutInfo *roi)
* matching lag, #GNUNET_SYSERR on database trouble
*/
static enum GNUNET_GenericReturnValue
-check_closure_lag (const struct ReserveOutInfo *roi)
+check_closure_lag (const struct WireTransferOutInfo *roi)
{
enum GNUNET_DB_QueryStatus qs;
@@ -1015,7 +1010,7 @@ check_closure_lag (const struct ReserveOutInfo *roi)
*
* @param cls a `struct WireAccount`
* @param key unused key
- * @param value the `struct ReserveOutInfo` to report
+ * @param value the `struct WireTransferOutInfo` to report
* @return #GNUNET_OK on success
*/
static enum GNUNET_GenericReturnValue
@@ -1024,7 +1019,7 @@ complain_out_not_found (void *cls,
void *value)
{
// struct WireAccount *wa = cls;
- struct ReserveOutInfo *roi = value;
+ struct WireTransferOutInfo *roi = value;
struct GNUNET_HashCode rkey;
struct CheckMatchContext cmx = {
.roi = roi,
@@ -1107,7 +1102,7 @@ wire_out_cb (
{
struct WireAccount *wa = cls;
struct GNUNET_HashCode key;
- struct ReserveOutInfo *roi;
+ struct WireTransferOutInfo *roi;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Exchange wire OUT #%llu at %s of %s with WTID %s\n",
@@ -1277,9 +1272,10 @@ wire_out_cb (
/**
- * Main function for processing 'reserves_out' data. We start by going over
+ * Main function for processing 'debit' data. We start by going over
* the DEBIT transactions this time, and then verify that all of them are
- * justified by 'reserves_out'.
+ * justified by reserve closures, profit drains or regular outgoing
+ * wire transfers from aggregated deposits.
*
* @param[in,out] wa wire account list to process
*/
@@ -1381,7 +1377,7 @@ history_debit_cb (
const struct TALER_BANK_DebitHistoryResponse *dhr)
{
struct WireAccount *wa = cls;
- struct ReserveOutInfo *roi;
+ struct WireTransferOutInfo *roi;
size_t slen;
wa->dhh = NULL;
@@ -1412,7 +1408,7 @@ history_debit_cb (
TALER_B2S (&dd->wtid));
wa->wire_off_out = dd->serial_id + 1;
slen = strlen (dd->credit_account_uri.full_payto) + 1;
- roi = GNUNET_malloc (sizeof (struct ReserveOutInfo)
+ roi = GNUNET_malloc (sizeof (struct WireTransferOutInfo)
+ slen);
GNUNET_CRYPTO_hash (&dd->wtid,
sizeof (dd->wtid),
@@ -1828,7 +1824,7 @@ run (void *cls,
(void) cfgfile;
cfg = c;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Launching wire auditor\n");
+ "Launching wire debit auditor\n");
if (GNUNET_OK !=
TALER_ARL_init (c))
{
@@ -1839,15 +1835,6 @@ run (void *cls,
reserve_closures
= GNUNET_CONTAINER_multihashmap_create (1024,
GNUNET_NO);
- if (GNUNET_OK !=
- TALER_config_get_amount (TALER_ARL_cfg,
- "auditor",
- "TINY_AMOUNT",
- &tiny_amount))
- {
- global_ret = EXIT_NOTCONFIGURED;
- return;
- }
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (TALER_ARL_currency,
&zero));