summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c3
-rw-r--r--src/auditor/taler-helper-auditor-coins.c7
-rw-r--r--src/auditor/taler-helper-auditor-deposits.c81
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c5
4 files changed, 44 insertions, 52 deletions
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 811bb66d4..cac357d5c 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -1502,8 +1502,7 @@ run (void *cls,
/**
- * The main function of the database initialization tool.
- * Used to initialize the Taler Exchange's database.
+ * The main function to audit the exchange's aggregation processing.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index 9412016b0..66c2b68a4 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
- * @file auditor/taler-helper-auditor0coins.c
+ * @file auditor/taler-helper-auditor-coins.c
* @brief audits coins in an exchange database.
* @author Christian Grothoff
*
@@ -2325,8 +2325,7 @@ run (void *cls,
/**
- * The main function of the database initialization tool.
- * Used to initialize the Taler Exchange's database.
+ * The main function to audit operations on coins.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
@@ -2368,4 +2367,4 @@ main (int argc,
}
-/* end of taler-auditor.c */
+/* end of taler-helper-auditor-coins.c */
diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c
index 1ca8b4f3c..4fa9076b0 100644
--- a/src/auditor/taler-helper-auditor-deposits.c
+++ b/src/auditor/taler-helper-auditor-deposits.c
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
- * @file auditor/taler-auditor-deposits.c
+ * @file auditor/taler-helper-auditor-deposits.c
* @brief audits an exchange database for deposit confirmation consistency
* @author Christian Grothoff
*/
@@ -102,37 +102,37 @@ test_dc (void *cls,
const struct TALER_AUDITORDB_DepositConfirmation *dc)
{
struct DepositConfirmationContext *dcc = cls;
- enum GNUNET_DB_QueryStatus qs;
- struct TALER_EXCHANGEDB_Deposit dep;
dcc->last_seen_coin_serial = serial_id;
- memset (&dep,
- 0,
- sizeof (dep));
- dep.coin.coin_pub = dc->coin_pub;
- dep.h_contract_terms = dc->h_contract_terms;
- dep.merchant_pub = dc->merchant;
- dep.h_wire = dc->h_wire;
- dep.refund_deadline = dc->refund_deadline;
-
- qs = TALER_ARL_edb->have_deposit (TALER_ARL_edb->cls,
- TALER_ARL_esession,
- &dep,
- GNUNET_NO /* do not check refund deadline */);
- if (qs > 0)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Found deposit %s in exchange database\n",
- GNUNET_h2s (&dc->h_contract_terms));
- return; /* found, all good */
- }
- if (qs < 0)
{
- GNUNET_break (0); /* DB error, complain */
- dcc->qs = qs;
- return;
+ enum GNUNET_DB_QueryStatus qs;
+ struct TALER_EXCHANGEDB_Deposit dep = {
+ .coin.coin_pub = dc->coin_pub,
+ .h_contract_terms = dc->h_contract_terms,
+ .merchant_pub = dc->merchant,
+ .h_wire = dc->h_wire,
+ .refund_deadline = dc->refund_deadline
+ };
+
+ qs = TALER_ARL_edb->have_deposit (TALER_ARL_edb->cls,
+ TALER_ARL_esession,
+ &dep,
+ GNUNET_NO /* do not check refund deadline */);
+ if (qs > 0)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Found deposit %s in exchange database\n",
+ GNUNET_h2s (&dc->h_contract_terms));
+ return; /* found, all good */
+ }
+ if (qs < 0)
+ {
+ GNUNET_break (0); /* DB error, complain */
+ dcc->qs = qs;
+ return;
+ }
}
- /* deposit confirmation missing! TALER_ARL_report! */
+ /* deposit confirmation missing! report! */
TALER_ARL_report (report_deposit_confirmation_inconsistencies,
json_pack ("{s:o, s:o, s:I, s:o}",
"timestamp",
@@ -176,8 +176,7 @@ analyze_deposit_confirmations (void *cls)
qsp = TALER_ARL_adb->get_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
- &
- TALER_ARL_master_pub,
+ &TALER_ARL_master_pub,
&ppdc);
if (0 > qsp)
{
@@ -187,13 +186,12 @@ analyze_deposit_confirmations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsp)
{
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- _ (
- "First analysis using this auditor, starting audit from scratch\n"));
+ "First analysis using deposit auditor, starting audit from scratch\n");
}
else
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _ ("Resuming deposit confirmation audit at %llu\n"),
+ "Resuming deposit confirmation audit at %llu\n",
(unsigned long long) ppdc.last_deposit_confirmation_serial_id);
}
@@ -235,15 +233,13 @@ analyze_deposit_confirmations (void *cls)
qs = TALER_ARL_adb->update_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
- &
- TALER_ARL_master_pub,
+ &TALER_ARL_master_pub,
&ppdc);
else
qs = TALER_ARL_adb->insert_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
TALER_ARL_asession,
- &
- TALER_ARL_master_pub,
+ &TALER_ARL_master_pub,
&ppdc);
if (0 >= qs)
{
@@ -256,7 +252,7 @@ analyze_deposit_confirmations (void *cls)
total_missed_deposit_confirmations = dcc.missed_amount;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _ ("Concluded deposit confirmation audit step at %llu\n"),
+ "Concluded deposit confirmation audit step at %llu\n",
(unsigned long long) ppdc.last_deposit_confirmation_serial_id);
return qs;
}
@@ -267,18 +263,18 @@ analyze_deposit_confirmations (void *cls)
*
* @param cls closure
* @param args remaining command-line arguments
- * @param TALER_ARL_cfgfile name of the configuration file used (for saving, can be NULL!)
+ * @param cfgfile name of the configuration file used (for saving, can be NULL!)
* @param c configuration
*/
static void
run (void *cls,
char *const *args,
- const char *TALER_ARL_cfgfile,
+ const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
(void) cls;
(void) args;
- (void) TALER_ARL_cfgfile;
+ (void) cfgfile;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Launching auditor\n");
if (GNUNET_OK !=
@@ -325,8 +321,7 @@ run (void *cls,
/**
- * The main function of the database initialization tool.
- * Used to initialize the Taler Exchange's database.
+ * The main function of the deposit auditing helper tool.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index 2e9385694..11d2f5648 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -1624,8 +1624,7 @@ run (void *cls,
/**
- * The main function of the database initialization tool.
- * Used to initialize the Taler Exchange's database.
+ * The main function to check the database's handling of reserves.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
@@ -1667,4 +1666,4 @@ main (int argc,
}
-/* end of taler-auditor-reserves.c */
+/* end of taler-helper-auditor-reserves.c */