diff options
Diffstat (limited to 'src/auditor/report-lib.c')
-rw-r--r-- | src/auditor/report-lib.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c index 0ae1cc1f6..4addce9e2 100644 --- a/src/auditor/report-lib.c +++ b/src/auditor/report-lib.c | |||
@@ -47,11 +47,6 @@ const struct GNUNET_CONFIGURATION_Handle *TALER_ARL_cfg; | |||
47 | struct TALER_AUDITORDB_Plugin *TALER_ARL_adb; | 47 | struct TALER_AUDITORDB_Plugin *TALER_ARL_adb; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Our session with the #TALER_ARL_adb. | ||
51 | */ | ||
52 | struct TALER_AUDITORDB_Session *TALER_ARL_asession; | ||
53 | |||
54 | /** | ||
55 | * Master public key of the exchange to audit. | 50 | * Master public key of the exchange to audit. |
56 | */ | 51 | */ |
57 | struct TALER_MasterPublicKeyP TALER_ARL_master_pub; | 52 | struct TALER_MasterPublicKeyP TALER_ARL_master_pub; |
@@ -310,8 +305,7 @@ transact (TALER_ARL_Analysis analysis, | |||
310 | int ret; | 305 | int ret; |
311 | enum GNUNET_DB_QueryStatus qs; | 306 | enum GNUNET_DB_QueryStatus qs; |
312 | 307 | ||
313 | ret = TALER_ARL_adb->start (TALER_ARL_adb->cls, | 308 | ret = TALER_ARL_adb->start (TALER_ARL_adb->cls); |
314 | TALER_ARL_asession); | ||
315 | if (GNUNET_OK != ret) | 309 | if (GNUNET_OK != ret) |
316 | { | 310 | { |
317 | GNUNET_break (0); | 311 | GNUNET_break (0); |
@@ -340,13 +334,11 @@ transact (TALER_ARL_Analysis analysis, | |||
340 | GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); | 334 | GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); |
341 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 335 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
342 | "Exchange DB commit failed, rolling back transaction\n"); | 336 | "Exchange DB commit failed, rolling back transaction\n"); |
343 | TALER_ARL_adb->rollback (TALER_ARL_adb->cls, | 337 | TALER_ARL_adb->rollback (TALER_ARL_adb->cls); |
344 | TALER_ARL_asession); | ||
345 | } | 338 | } |
346 | else | 339 | else |
347 | { | 340 | { |
348 | qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls, | 341 | qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls); |
349 | TALER_ARL_asession); | ||
350 | if (0 > qs) | 342 | if (0 > qs) |
351 | { | 343 | { |
352 | GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); | 344 | GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); |
@@ -359,8 +351,7 @@ transact (TALER_ARL_Analysis analysis, | |||
359 | { | 351 | { |
360 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 352 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
361 | "Processing failed (or no changes), rolling back transaction\n"); | 353 | "Processing failed (or no changes), rolling back transaction\n"); |
362 | TALER_ARL_adb->rollback (TALER_ARL_adb->cls, | 354 | TALER_ARL_adb->rollback (TALER_ARL_adb->cls); |
363 | TALER_ARL_asession); | ||
364 | TALER_ARL_edb->rollback (TALER_ARL_edb->cls); | 355 | TALER_ARL_edb->rollback (TALER_ARL_edb->cls); |
365 | } | 356 | } |
366 | switch (qs) | 357 | switch (qs) |
@@ -389,15 +380,15 @@ int | |||
389 | TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana, | 380 | TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana, |
390 | void *ana_cls) | 381 | void *ana_cls) |
391 | { | 382 | { |
392 | if (GNUNET_OK != | 383 | if (GNUNET_SYSERR == |
393 | TALER_ARL_edb->preflight (TALER_ARL_edb->cls)) | 384 | TALER_ARL_edb->preflight (TALER_ARL_edb->cls)) |
394 | { | 385 | { |
395 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 386 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
396 | "Failed to initialize exchange connection.\n"); | 387 | "Failed to initialize exchange connection.\n"); |
397 | return GNUNET_SYSERR; | 388 | return GNUNET_SYSERR; |
398 | } | 389 | } |
399 | TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls); | 390 | if (GNUNET_SYSERR == |
400 | if (NULL == TALER_ARL_asession) | 391 | TALER_ARL_adb->preflight (TALER_ARL_adb->cls)) |
401 | { | 392 | { |
402 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 393 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
403 | "Failed to initialize auditor session.\n"); | 394 | "Failed to initialize auditor session.\n"); |
@@ -804,11 +795,10 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) | |||
804 | return GNUNET_SYSERR; | 795 | return GNUNET_SYSERR; |
805 | } | 796 | } |
806 | { | 797 | { |
807 | struct TALER_AUDITORDB_Session *as; | ||
808 | int found; | 798 | int found; |
809 | 799 | ||
810 | as = TALER_ARL_adb->get_session (TALER_ARL_adb->cls); | 800 | if (GNUNET_SYSERR == |
811 | if (NULL == as) | 801 | TALER_ARL_adb->preflight (TALER_ARL_adb->cls)) |
812 | { | 802 | { |
813 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 803 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
814 | "Failed to start session with auditor database.\n"); | 804 | "Failed to start session with auditor database.\n"); |
@@ -817,7 +807,6 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) | |||
817 | } | 807 | } |
818 | found = GNUNET_NO; | 808 | found = GNUNET_NO; |
819 | (void) TALER_ARL_adb->list_exchanges (TALER_ARL_adb->cls, | 809 | (void) TALER_ARL_adb->list_exchanges (TALER_ARL_adb->cls, |
820 | as, | ||
821 | &test_master_present, | 810 | &test_master_present, |
822 | &found); | 811 | &found); |
823 | if (GNUNET_NO == found) | 812 | if (GNUNET_NO == found) |