aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-21 17:01:21 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-21 17:01:36 +0200
commit05b0a74df2fe34c68ada0ef7773926104494da85 (patch)
treedf649a5ab9ede121dffb92a8e858d721b59f99d0 /src
parente8e1073813f07f61e65959dfffc280bc5beeffde (diff)
auditor bugfixes
Diffstat (limited to 'src')
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c39
-rw-r--r--src/auditor/taler-helper-auditor-coins.c67
-rw-r--r--src/auditor/taler-helper-auditor-purses.c35
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c63
-rw-r--r--src/auditor/taler-helper-auditor-wire-credit.c83
-rw-r--r--src/auditor/taler-helper-auditor-wire-debit.c97
-rw-r--r--src/auditordb/pg_get_balance.c8
-rw-r--r--src/auditordb/pg_insert_row_inconsistency.c4
8 files changed, 71 insertions, 325 deletions
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 4353499fa..0011e3607 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -1335,45 +1335,6 @@ analyze_aggregations (void *cls)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qsx);
return qsx;
}
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
- {
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_wire_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_arithmetic_delta_plus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_arithmetic_delta_minus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_bad_sig_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_wire_out_delta_plus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_wire_out_delta_minus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (
- TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- aggregation_total_coin_delta_plus)));
- }
-
ac.qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
qs = TALER_ARL_edb->select_wire_out_above_serial_id (
TALER_ARL_edb->cls,
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index 03878e5c1..f21d9fca4 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -2528,73 +2528,6 @@ analyze_coins (void *cls)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qsx);
return qsx;
}
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Found no balance, starting by 0.\n");
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_balance_risk)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_emergencies_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_reported_emergency_risk_by_amount)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_reported_emergency_risk_by_count)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_emergencies_loss_by_count)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_escrowed)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_deposit_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_melt_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_refund_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_balance_risk)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_recoup_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coin_irregular_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_total_arithmetic_delta_plus)))
- ;
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- coins_total_arithmetic_delta_minus))
- );
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_refresh_hanging)));
- }
/* process withdrawals */
if (0 >
(qs = TALER_ARL_edb->select_withdrawals_above_serial_id (
diff --git a/src/auditor/taler-helper-auditor-purses.c b/src/auditor/taler-helper-auditor-purses.c
index 625dfb1a6..ad23d3e27 100644
--- a/src/auditor/taler-helper-auditor-purses.c
+++ b/src/auditor/taler-helper-auditor-purses.c
@@ -1172,41 +1172,6 @@ analyze_purses (void *cls)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qsx);
return qsx;
}
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Found no balance, starting by 0.\n");
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_global_balance)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_balance_insufficient_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_delayed_decisions)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_arithmetic_delta_plus)))
- ;
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_arithmetic_delta_minus))
- );
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_balance_purse_not_closed)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- purse_total_bad_sig_loss)));
- }
pc.purses = GNUNET_CONTAINER_multihashmap_create (512,
GNUNET_NO);
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index 9b0d46808..e58a094f9 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -1744,69 +1744,6 @@ analyze_reserves (void *cls)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qsx);
return qsx;
}
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
- {
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_reserve_total_balance)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_reserve_total_balance)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_reserve_loss)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_withdraw_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_close_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_purse_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_open_fee_revenue)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_history_fee_revenue)));
- // REVIEW:
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_balance_summary_delta_plus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_balance_summary_delta_minus)))
- ;
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_total_arithmetic_delta_plus))
- );
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_total_arithmetic_delta_minus)
- ));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_balance_reserve_not_closed)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- reserves_total_bad_sig_loss)));
- }
rc.reserves = GNUNET_CONTAINER_multihashmap_create (512,
GNUNET_NO);
rc.revoked = GNUNET_CONTAINER_multihashmap_create (4,
diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c
index 9c0233045..bf6856743 100644
--- a/src/auditor/taler-helper-auditor-wire-credit.c
+++ b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -152,24 +152,24 @@ static struct TALER_Amount tiny_amount;
/**
* Total amount that was transferred too much to the exchange.
*/
-static struct TALER_Amount total_bad_amount_in_plus;
+static TALER_ARL_DEF_AB (total_bad_amount_in_plus);
/**
* Total amount that was transferred too little to the exchange.
*/
-static struct TALER_Amount total_bad_amount_in_minus;
+static TALER_ARL_DEF_AB (total_bad_amount_in_minus);
/**
* Total amount where the exchange has the wrong sender account
* for incoming funds and may thus wire funds to the wrong
* destination when closing the reserve.
*/
-static struct TALER_Amount total_misattribution_in;
+static TALER_ARL_DEF_AB (total_misattribution_in);
/**
* Total amount affected by wire format troubles.
*/
-static struct TALER_Amount total_wire_format_amount; // FIXME
+static TALER_ARL_DEF_AB (total_wire_format_amount); // FIXME
/**
* Total amount credited to exchange accounts.
@@ -343,6 +343,10 @@ commit (enum GNUNET_DB_QueryStatus qs)
qs = TALER_ARL_adb->update_balance (
TALER_ARL_adb->cls,
TALER_ARL_SET_AB (total_wire_in),
+ TALER_ARL_SET_AB (total_bad_amount_in_plus),
+ TALER_ARL_SET_AB (total_bad_amount_in_minus),
+ TALER_ARL_SET_AB (total_misattribution_in),
+ TALER_ARL_SET_AB (total_wire_format_amount),
NULL);
}
else
@@ -350,6 +354,10 @@ commit (enum GNUNET_DB_QueryStatus qs)
qs = TALER_ARL_adb->insert_balance (
TALER_ARL_adb->cls,
TALER_ARL_SET_AB (total_wire_in),
+ TALER_ARL_SET_AB (total_bad_amount_in_plus),
+ TALER_ARL_SET_AB (total_bad_amount_in_minus),
+ TALER_ARL_SET_AB (total_misattribution_in),
+ TALER_ARL_SET_AB (total_wire_format_amount),
NULL);
}
}
@@ -559,8 +567,8 @@ complain_in_not_found (void *cls,
global_qs = qs;
return GNUNET_SYSERR;
}
- TALER_ARL_amount_add (&total_bad_amount_in_minus,
- &total_bad_amount_in_minus,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_in_minus),
+ &TALER_ARL_USE_AB (total_bad_amount_in_minus),
&rii->credit_details.amount);
return GNUNET_OK;
}
@@ -669,11 +677,11 @@ analyze_credit (
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
return false;
}
- TALER_ARL_amount_add (&total_bad_amount_in_minus,
- &total_bad_amount_in_minus,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_in_minus),
+ &TALER_ARL_USE_AB (total_bad_amount_in_minus),
&rii->credit_details.amount);
- TALER_ARL_amount_add (&total_bad_amount_in_plus,
- &total_bad_amount_in_plus,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_in_plus),
+ &TALER_ARL_USE_AB (total_bad_amount_in_plus),
&credit_details->amount);
GNUNET_assert (GNUNET_OK ==
free_rii (NULL,
@@ -713,8 +721,8 @@ analyze_credit (
TALER_ARL_amount_subtract (&delta,
&credit_details->amount,
&rii->credit_details.amount);
- TALER_ARL_amount_add (&total_bad_amount_in_plus,
- &total_bad_amount_in_plus,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_in_plus),
+ &TALER_ARL_USE_AB (total_bad_amount_in_plus),
&delta);
}
else
@@ -725,8 +733,8 @@ analyze_credit (
TALER_ARL_amount_subtract (&delta,
&rii->credit_details.amount,
&credit_details->amount);
- TALER_ARL_amount_add (&total_bad_amount_in_minus,
- &total_bad_amount_in_minus,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_in_minus),
+ &TALER_ARL_USE_AB (total_bad_amount_in_minus),
&delta);
}
}
@@ -750,8 +758,8 @@ analyze_credit (
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
return false;
}
- TALER_ARL_amount_add (&total_misattribution_in,
- &total_misattribution_in,
+ TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_misattribution_in),
+ &TALER_ARL_USE_AB (total_misattribution_in),
&rii->credit_details.amount);
}
if (GNUNET_TIME_timestamp_cmp (credit_details->execution_date,
@@ -958,27 +966,13 @@ begin_transaction (void)
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_bad_amount_in_plus));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_bad_amount_in_minus));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_misattribution_in));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_wire_format_amount));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &zero));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_wire_in)));
qs = TALER_ARL_adb->get_balance (
TALER_ARL_adb->cls,
TALER_ARL_GET_AB (total_wire_in),
+ TALER_ARL_GET_AB (total_bad_amount_in_plus),
+ TALER_ARL_GET_AB (total_bad_amount_in_minus),
+ TALER_ARL_GET_AB (total_misattribution_in),
+ TALER_ARL_GET_AB (total_wire_format_amount),
NULL);
switch (qs)
{
@@ -989,9 +983,6 @@ begin_transaction (void)
GNUNET_break (0);
return qs;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_wire_in)));
had_start_balance = false;
break;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
@@ -1123,6 +1114,9 @@ run (void *cls,
global_ret = EXIT_NOTCONFIGURED;
return;
}
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (TALER_ARL_currency,
+ &zero));
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
NULL);
ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
@@ -1134,21 +1128,6 @@ run (void *cls,
global_ret = EXIT_FAILURE;
return;
}
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_bad_amount_in_plus));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_bad_amount_in_minus));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_misattribution_in));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &total_wire_format_amount));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &zero));
if (GNUNET_OK !=
TALER_EXCHANGEDB_load_accounts (TALER_ARL_cfg,
TALER_EXCHANGEDB_ALO_CREDIT
diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c
index 56ee9e5cd..e6bb4d50e 100644
--- a/src/auditor/taler-helper-auditor-wire-debit.c
+++ b/src/auditor/taler-helper-auditor-wire-debit.c
@@ -509,6 +509,12 @@ commit (enum GNUNET_DB_QueryStatus qs)
TALER_ARL_adb->cls,
TALER_ARL_SET_AB (total_drained),
TALER_ARL_SET_AB (total_wire_out),
+ TALER_ARL_SET_AB (total_bad_amount_out_plus),
+ TALER_ARL_SET_AB (total_bad_amount_out_minus),
+ TALER_ARL_SET_AB (total_amount_lag),
+ TALER_ARL_SET_AB (total_closure_amount_lag),
+ TALER_ARL_SET_AB (total_wire_format_amount),
+ TALER_ARL_SET_AB (total_wire_out),
NULL);
}
else
@@ -517,6 +523,12 @@ commit (enum GNUNET_DB_QueryStatus qs)
TALER_ARL_adb->cls,
TALER_ARL_SET_AB (total_drained),
TALER_ARL_SET_AB (total_wire_out),
+ TALER_ARL_SET_AB (total_bad_amount_out_plus),
+ TALER_ARL_SET_AB (total_bad_amount_out_minus),
+ TALER_ARL_SET_AB (total_amount_lag),
+ TALER_ARL_SET_AB (total_closure_amount_lag),
+ TALER_ARL_SET_AB (total_wire_format_amount),
+ TALER_ARL_SET_AB (total_wire_out),
NULL);
}
}
@@ -653,11 +665,12 @@ struct ImportMissingWireContext
* @param deadline what was the earliest requested wire transfer deadline
*/
static void
-import_wire_missing_cb (void *cls,
- uint64_t batch_deposit_serial_id,
- const struct TALER_Amount *total_amount,
- const struct TALER_PaytoHashP *wire_target_h_payto,
- struct GNUNET_TIME_Timestamp deadline)
+import_wire_missing_cb (
+ void *cls,
+ uint64_t batch_deposit_serial_id,
+ const struct TALER_Amount *total_amount,
+ const struct TALER_PaytoHashP *wire_target_h_payto,
+ struct GNUNET_TIME_Timestamp deadline)
{
struct ImportMissingWireContext *wc = cls;
enum GNUNET_DB_QueryStatus qs;
@@ -825,11 +838,12 @@ generate_report (void *cls,
* @param deadline what was the earliest requested wire transfer deadline
*/
static void
-report_wire_missing_cb (void *cls,
- uint64_t batch_deposit_serial_id,
- const struct TALER_Amount *total_amount,
- const struct TALER_PaytoHashP *wire_target_h_payto,
- struct GNUNET_TIME_Timestamp deadline)
+report_wire_missing_cb (
+ void *cls,
+ uint64_t batch_deposit_serial_id,
+ const struct TALER_Amount *total_amount,
+ const struct TALER_PaytoHashP *wire_target_h_payto,
+ struct GNUNET_TIME_Timestamp deadline)
{
struct ReportMissingWireContext *rc = cls;
struct ReasonDetail *rd;
@@ -1797,35 +1811,16 @@ begin_transaction (void)
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_bad_amount_out_plus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_bad_amount_out_minus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_amount_lag)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_closure_amount_lag)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_wire_format_amount)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &zero));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_wire_out)));
qs = TALER_ARL_adb->get_balance (
TALER_ARL_adb->cls,
TALER_ARL_GET_AB (total_drained),
TALER_ARL_GET_AB (total_wire_out),
+ TALER_ARL_GET_AB (total_bad_amount_out_plus),
+ TALER_ARL_GET_AB (total_bad_amount_out_minus),
+ TALER_ARL_GET_AB (total_amount_lag),
+ TALER_ARL_GET_AB (total_closure_amount_lag),
+ TALER_ARL_GET_AB (total_wire_format_amount),
+ TALER_ARL_GET_AB (total_wire_out),
NULL);
switch (qs)
{
@@ -1836,13 +1831,6 @@ begin_transaction (void)
GNUNET_break (0);
return qs;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_drained)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_wire_out)))
- ;
had_start_balance = false;
break;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
@@ -2022,6 +2010,9 @@ run (void *cls,
global_ret = EXIT_NOTCONFIGURED;
return;
}
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (TALER_ARL_currency,
+ &zero));
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
NULL);
ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
@@ -2035,28 +2026,6 @@ run (void *cls,
}
reserve_closures = GNUNET_CONTAINER_multihashmap_create (1024,
GNUNET_NO);
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_bad_amount_out_plus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_bad_amount_out_minus)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (total_amount_lag)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_closure_amount_lag)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &TALER_ARL_USE_AB (
- total_wire_format_amount)));
- GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (TALER_ARL_currency,
- &zero));
if (GNUNET_OK !=
TALER_EXCHANGEDB_load_accounts (TALER_ARL_cfg,
TALER_EXCHANGEDB_ALO_DEBIT
diff --git a/src/auditordb/pg_get_balance.c b/src/auditordb/pg_get_balance.c
index 4edc1c89f..2bacbb507 100644
--- a/src/auditordb/pg_get_balance.c
+++ b/src/auditordb/pg_get_balance.c
@@ -56,6 +56,7 @@ struct BalanceContext
* Set to true on failure.
*/
bool failure;
+
};
@@ -99,9 +100,10 @@ balance_cb (void *cls,
return;
}
if (is_missing)
- memset (ctx->dst[i],
- 0,
- sizeof (struct TALER_Amount));
+ {
+ TALER_amount_set_zero (pg->currency,
+ ctx->dst[i]);
+ }
ctx->off++;
}
}
diff --git a/src/auditordb/pg_insert_row_inconsistency.c b/src/auditordb/pg_insert_row_inconsistency.c
index 119b7fa34..8ab92dbb7 100644
--- a/src/auditordb/pg_insert_row_inconsistency.c
+++ b/src/auditordb/pg_insert_row_inconsistency.c
@@ -33,13 +33,13 @@ TAH_PG_insert_row_inconsistency (
};
PREPARE (pg,
- "auditor_deposit_confirmation_insert",
+ "auditor_insert_row_inconsistency",
"INSERT INTO auditor_row_inconsistency "
"(row_table"
",diagnostic"
",problem_row_id"
") VALUES ($1,$2,$3);");
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "auditor_deposit_confirmation_insert",
+ "auditor_insert_row_inconsistency",
params);
}