diff options
Diffstat (limited to 'src/auditor/taler-helper-auditor-deposits.c')
-rw-r--r-- | src/auditor/taler-helper-auditor-deposits.c | 64 |
1 files changed, 27 insertions, 37 deletions
diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c index a0a86540f..17b32f25e 100644 --- a/src/auditor/taler-helper-auditor-deposits.c +++ b/src/auditor/taler-helper-auditor-deposits.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of TALER | 2 | This file is part of TALER |
3 | Copyright (C) 2016-2020 Taler Systems SA | 3 | Copyright (C) 2016-2021 Taler Systems SA |
4 | 4 | ||
5 | TALER is free software; you can redistribute it and/or modify it under the | 5 | TALER is free software; you can redistribute it and/or modify it under the |
6 | terms of the GNU Affero Public License as published by the Free Software | 6 | terms of the GNU Affero Public License as published by the Free Software |
@@ -146,16 +146,15 @@ test_dc (void *cls, | |||
146 | } | 146 | } |
147 | /* deposit confirmation missing! report! */ | 147 | /* deposit confirmation missing! report! */ |
148 | TALER_ARL_report (report_deposit_confirmation_inconsistencies, | 148 | TALER_ARL_report (report_deposit_confirmation_inconsistencies, |
149 | json_pack ("{s:o, s:o, s:I, s:o}", | 149 | GNUNET_JSON_PACK ( |
150 | "timestamp", | 150 | TALER_JSON_pack_time_abs_human ("timestamp", |
151 | TALER_ARL_json_from_time_abs ( | 151 | dc->exchange_timestamp), |
152 | dc->exchange_timestamp), | 152 | TALER_JSON_pack_amount ("amount", |
153 | "amount", | 153 | &dc->amount_without_fee), |
154 | TALER_JSON_from_amount (&dc->amount_without_fee), | 154 | GNUNET_JSON_pack_uint64 ("rowid", |
155 | "rowid", | 155 | serial_id), |
156 | (json_int_t) serial_id, | 156 | GNUNET_JSON_pack_data_auto ("account", |
157 | "account", | 157 | &dc->h_wire))); |
158 | GNUNET_JSON_from_data_auto (&dc->h_wire))); | ||
159 | dcc->first_missed_coin_serial = GNUNET_MIN (dcc->first_missed_coin_serial, | 158 | dcc->first_missed_coin_serial = GNUNET_MIN (dcc->first_missed_coin_serial, |
160 | serial_id); | 159 | serial_id); |
161 | dcc->missed_count++; | 160 | dcc->missed_count++; |
@@ -295,7 +294,7 @@ run (void *cls, | |||
295 | if (GNUNET_OK != | 294 | if (GNUNET_OK != |
296 | TALER_ARL_init (c)) | 295 | TALER_ARL_init (c)) |
297 | { | 296 | { |
298 | global_ret = 1; | 297 | global_ret = EXIT_FAILURE; |
299 | return; | 298 | return; |
300 | } | 299 | } |
301 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 300 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -306,32 +305,23 @@ run (void *cls, | |||
306 | TALER_ARL_setup_sessions_and_run (&analyze_deposit_confirmations, | 305 | TALER_ARL_setup_sessions_and_run (&analyze_deposit_confirmations, |
307 | NULL)) | 306 | NULL)) |
308 | { | 307 | { |
309 | global_ret = 1; | 308 | global_ret = EXIT_FAILURE; |
310 | return; | 309 | return; |
311 | } | 310 | } |
312 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 311 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
313 | "Deposit audit complete\n"); | 312 | "Deposit audit complete\n"); |
314 | { | 313 | TALER_ARL_done ( |
315 | json_t *report; | 314 | GNUNET_JSON_PACK ( |
316 | 315 | GNUNET_JSON_pack_array_steal ("deposit_confirmation_inconsistencies", | |
317 | report = json_pack ("{s:o, s:I, s:o, s:o, s:o}", | 316 | report_deposit_confirmation_inconsistencies), |
318 | "deposit_confirmation_inconsistencies", | 317 | GNUNET_JSON_pack_uint64 ("missing_deposit_confirmation_count", |
319 | report_deposit_confirmation_inconsistencies, | 318 | number_missed_deposit_confirmations), |
320 | "missing_deposit_confirmation_count", | 319 | TALER_JSON_pack_amount ("missing_deposit_confirmation_total", |
321 | (json_int_t) number_missed_deposit_confirmations, | 320 | &total_missed_deposit_confirmations), |
322 | "missing_deposit_confirmation_total", | 321 | TALER_JSON_pack_time_abs_human ("auditor_start_time", |
323 | TALER_JSON_from_amount ( | 322 | start_time), |
324 | &total_missed_deposit_confirmations), | 323 | TALER_JSON_pack_time_abs_human ("auditor_end_time", |
325 | "auditor_start_time", | 324 | GNUNET_TIME_absolute_get ()))); |
326 | TALER_ARL_json_from_time_abs ( | ||
327 | start_time), | ||
328 | "auditor_end_time", | ||
329 | TALER_ARL_json_from_time_abs ( | ||
330 | GNUNET_TIME_absolute_get ()) | ||
331 | ); | ||
332 | GNUNET_break (NULL != report); | ||
333 | TALER_ARL_done (report); | ||
334 | } | ||
335 | } | 325 | } |
336 | 326 | ||
337 | 327 | ||
@@ -369,7 +359,7 @@ main (int argc, | |||
369 | if (GNUNET_OK != | 359 | if (GNUNET_OK != |
370 | GNUNET_STRINGS_get_utf8_args (argc, argv, | 360 | GNUNET_STRINGS_get_utf8_args (argc, argv, |
371 | &argc, &argv)) | 361 | &argc, &argv)) |
372 | return 4; | 362 | return EXIT_INVALIDARGUMENT; |
373 | ret = GNUNET_PROGRAM_run ( | 363 | ret = GNUNET_PROGRAM_run ( |
374 | argc, | 364 | argc, |
375 | argv, | 365 | argv, |
@@ -381,9 +371,9 @@ main (int argc, | |||
381 | NULL); | 371 | NULL); |
382 | GNUNET_free_nz ((void *) argv); | 372 | GNUNET_free_nz ((void *) argv); |
383 | if (GNUNET_SYSERR == ret) | 373 | if (GNUNET_SYSERR == ret) |
384 | return 3; | 374 | return EXIT_INVALIDARGUMENT; |
385 | if (GNUNET_NO == ret) | 375 | if (GNUNET_NO == ret) |
386 | return 0; | 376 | return EXIT_SUCCESS; |
387 | return global_ret; | 377 | return global_ret; |
388 | } | 378 | } |
389 | 379 | ||