aboutsummaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-23 08:24:59 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-23 08:24:59 +0200
commit01e06eb715938b914c54123c21c7c7678e08ee02 (patch)
tree85d8053916faa7bfddb711023d8c7959cb83aa5f /src/auditor
parent82a5038acf5302957ca450d9c262f6fed59a45ba (diff)
-remove sessions also from auditor
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/report-lib.c29
-rw-r--r--src/auditor/report-lib.h5
-rw-r--r--src/auditor/taler-auditor-exchange.c11
-rw-r--r--src/auditor/taler-auditor-httpd_deposit-confirmation.c7
-rw-r--r--src/auditor/taler-auditor-httpd_exchanges.c6
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c6
-rw-r--r--src/auditor/taler-helper-auditor-coins.c11
-rw-r--r--src/auditor/taler-helper-auditor-deposits.c4
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c10
-rw-r--r--src/auditor/taler-helper-auditor-wire.c27
10 files changed, 25 insertions, 91 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;
struct TALER_AUDITORDB_Plugin *TALER_ARL_adb;
/**
- * Our session with the #TALER_ARL_adb.
- */
-struct TALER_AUDITORDB_Session *TALER_ARL_asession;
-
-/**
* Master public key of the exchange to audit.
*/
struct TALER_MasterPublicKeyP TALER_ARL_master_pub;
@@ -310,8 +305,7 @@ transact (TALER_ARL_Analysis analysis,
int ret;
enum GNUNET_DB_QueryStatus qs;
- ret = TALER_ARL_adb->start (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ ret = TALER_ARL_adb->start (TALER_ARL_adb->cls);
if (GNUNET_OK != ret)
{
GNUNET_break (0);
@@ -340,13 +334,11 @@ transact (TALER_ARL_Analysis analysis,
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Exchange DB commit failed, rolling back transaction\n");
- TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
}
else
{
- qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -359,8 +351,7 @@ transact (TALER_ARL_Analysis analysis,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing failed (or no changes), rolling back transaction\n");
- TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
}
switch (qs)
@@ -389,15 +380,15 @@ int
TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana,
void *ana_cls)
{
- if (GNUNET_OK !=
+ if (GNUNET_SYSERR ==
TALER_ARL_edb->preflight (TALER_ARL_edb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize exchange connection.\n");
return GNUNET_SYSERR;
}
- TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
- if (NULL == TALER_ARL_asession)
+ if (GNUNET_SYSERR ==
+ TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize auditor session.\n");
@@ -804,11 +795,10 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
return GNUNET_SYSERR;
}
{
- struct TALER_AUDITORDB_Session *as;
int found;
- as = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
- if (NULL == as)
+ if (GNUNET_SYSERR ==
+ TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to start session with auditor database.\n");
@@ -817,7 +807,6 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c)
}
found = GNUNET_NO;
(void) TALER_ARL_adb->list_exchanges (TALER_ARL_adb->cls,
- as,
&test_master_present,
&found);
if (GNUNET_NO == found)
diff --git a/src/auditor/report-lib.h b/src/auditor/report-lib.h
index d8d825914..7c01b1685 100644
--- a/src/auditor/report-lib.h
+++ b/src/auditor/report-lib.h
@@ -60,11 +60,6 @@ extern const struct GNUNET_CONFIGURATION_Handle *TALER_ARL_cfg;
extern struct TALER_AUDITORDB_Plugin *TALER_ARL_adb;
/**
- * Our session with the #TALER_ARL_adb.
- */
-extern struct TALER_AUDITORDB_Session *TALER_ARL_asession;
-
-/**
* Master public key of the exchange to audit.
*/
extern struct TALER_MasterPublicKeyP TALER_ARL_master_pub;
diff --git a/src/auditor/taler-auditor-exchange.c b/src/auditor/taler-auditor-exchange.c
index b751ea9a4..04181ce3f 100644
--- a/src/auditor/taler-auditor-exchange.c
+++ b/src/auditor/taler-auditor-exchange.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015, 2018, 2019 Taler Systems SA
+ Copyright (C) 2014-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -176,13 +176,12 @@ main (int argc,
/* Update DB */
{
enum GNUNET_DB_QueryStatus qs;
- struct TALER_AUDITORDB_Session *session;
- session = adb->get_session (adb->cls);
- if (NULL == session)
+ if (GNUNET_SYSERR ==
+ adb->preflight (adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to initialize database session\n");
+ "Failed to initialize database connection\n");
TALER_AUDITORDB_plugin_unload (adb);
return EXIT_FAILURE;
}
@@ -190,13 +189,11 @@ main (int argc,
if (remove_flag)
{
qs = adb->delete_exchange (adb->cls,
- session,
&master_public_key);
}
else
{
qs = adb->insert_exchange (adb->cls,
- session,
&master_public_key,
exchange_url);
}
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.c b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
index f38e8ee71..c7a23d718 100644
--- a/src/auditor/taler-auditor-httpd_deposit-confirmation.c
+++ b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
@@ -62,7 +62,6 @@ verify_and_execute_deposit_confirmation (
const struct TALER_AUDITORDB_DepositConfirmation *dc,
const struct TALER_AUDITORDB_ExchangeSigningKey *es)
{
- struct TALER_AUDITORDB_Session *session;
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute now;
struct GNUNET_HashCode h;
@@ -96,8 +95,8 @@ verify_and_execute_deposit_confirmation (
cached = GNUNET_CONTAINER_multihashmap_get (cache,
&h);
GNUNET_assert (0 == pthread_mutex_unlock (&lock));
- session = TAH_plugin->get_session (TAH_plugin->cls);
- if (NULL == session)
+ if (GNUNET_SYSERR ==
+ TAH_plugin->preflight (TAH_plugin->cls))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@@ -126,7 +125,6 @@ verify_and_execute_deposit_confirmation (
/* execute transaction */
qs = TAH_plugin->insert_exchange_signkey (TAH_plugin->cls,
- session,
es);
if (0 > qs)
{
@@ -216,7 +214,6 @@ verify_and_execute_deposit_confirmation (
/* execute transaction */
qs = TAH_plugin->insert_deposit_confirmation (TAH_plugin->cls,
- session,
dc);
if (0 > qs)
{
diff --git a/src/auditor/taler-auditor-httpd_exchanges.c b/src/auditor/taler-auditor-httpd_exchanges.c
index 7b54b6d49..f9a9e9e60 100644
--- a/src/auditor/taler-auditor-httpd_exchanges.c
+++ b/src/auditor/taler-auditor-httpd_exchanges.c
@@ -75,15 +75,14 @@ TAH_EXCHANGES_handler (struct TAH_RequestHandler *rh,
size_t *upload_data_size)
{
json_t *ja;
- struct TALER_AUDITORDB_Session *session;
enum GNUNET_DB_QueryStatus qs;
(void) rh;
(void) connection_cls;
(void) upload_data;
(void) upload_data_size;
- session = TAH_plugin->get_session (TAH_plugin->cls);
- if (NULL == session)
+ if (GNUNET_SYSERR ==
+ TAH_plugin->preflight (TAH_plugin->cls))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@@ -94,7 +93,6 @@ TAH_EXCHANGES_handler (struct TAH_RequestHandler *rh,
ja = json_array ();
GNUNET_break (NULL != ja);
qs = TAH_plugin->list_exchanges (TAH_plugin->cls,
- session,
&add_exchange,
ja);
if (0 > qs)
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 3bc8c7701..468f66b44 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -1218,7 +1218,6 @@ analyze_aggregations (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing aggregations\n");
qsp = TALER_ARL_adb->get_auditor_progress_aggregation (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
if (0 > qsp)
@@ -1243,7 +1242,6 @@ analyze_aggregations (void *cls)
0,
sizeof (ac));
qsx = TALER_ARL_adb->get_wire_fee_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
if (0 > qsx)
@@ -1282,13 +1280,11 @@ analyze_aggregations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
ac.qs = TALER_ARL_adb->insert_wire_fee_summary (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
else
ac.qs = TALER_ARL_adb->update_wire_fee_summary (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_aggregation_fee_income);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ac.qs)
@@ -1299,13 +1295,11 @@ analyze_aggregations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_aggregation (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
else
qs = TALER_ARL_adb->insert_auditor_progress_aggregation (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppa);
if (0 >= qs)
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index a2c8b8cee..ba9cf6d18 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -679,7 +679,6 @@ init_denomination (const struct GNUNET_HashCode *denom_hash,
uint64_t rowid;
qs = TALER_ARL_adb->get_denomination_balance (TALER_ARL_adb->cls,
- TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@@ -819,7 +818,6 @@ sync_denomination (void *cls,
outstanding coins as revenue; and reduce cc->risk exposure. */
if (ds->in_db)
qs = TALER_ARL_adb->del_denomination_balance (TALER_ARL_adb->cls,
- TALER_ARL_asession,
denom_hash);
else
qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
@@ -851,7 +849,6 @@ sync_denomination (void *cls,
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
(qs = TALER_ARL_adb->insert_historic_denom_revenue (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
denom_hash,
expire_deposit,
@@ -905,7 +902,6 @@ sync_denomination (void *cls,
}
if (ds->in_db)
qs = TALER_ARL_adb->update_denomination_balance (TALER_ARL_adb->cls,
- TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@@ -914,7 +910,6 @@ sync_denomination (void *cls,
ds->num_issued);
else
qs = TALER_ARL_adb->insert_denomination_balance (TALER_ARL_adb->cls,
- TALER_ARL_asession,
denom_hash,
&ds->denom_balance,
&ds->denom_loss,
@@ -2333,7 +2328,6 @@ analyze_coins (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing coins\n");
qsp = TALER_ARL_adb->get_auditor_progress_coin (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
if (0 > qsp)
@@ -2363,7 +2357,6 @@ analyze_coins (void *cls)
cc.denom_summaries = GNUNET_CONTAINER_multihashmap_create (256,
GNUNET_NO);
qsx = TALER_ARL_adb->get_balance_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@@ -2473,7 +2466,6 @@ analyze_coins (void *cls)
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsx)
qs = TALER_ARL_adb->update_balance_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@@ -2484,7 +2476,6 @@ analyze_coins (void *cls)
&total_irregular_recoups);
else
qs = TALER_ARL_adb->insert_balance_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_deposit_fee_income,
@@ -2501,12 +2492,10 @@ analyze_coins (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_coin (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
else
qs = TALER_ARL_adb->insert_auditor_progress_coin (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppc);
if (0 >= qs)
diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c
index 58b41fbc3..58f8226f4 100644
--- a/src/auditor/taler-helper-auditor-deposits.c
+++ b/src/auditor/taler-helper-auditor-deposits.c
@@ -188,7 +188,6 @@ analyze_deposit_confirmations (void *cls)
ppdc.last_deposit_confirmation_serial_id = 0;
qsp = TALER_ARL_adb->get_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppdc);
if (0 > qsp)
@@ -217,7 +216,6 @@ analyze_deposit_confirmations (void *cls)
dcc.first_missed_coin_serial = UINT64_MAX;
qsx = TALER_ARL_adb->get_deposit_confirmations (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
ppdc.last_deposit_confirmation_serial_id,
&test_dc,
@@ -245,13 +243,11 @@ analyze_deposit_confirmations (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_deposit_confirmation (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&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,
&ppdc);
if (0 >= qs)
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index 592663da6..aa9c241bb 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -317,7 +317,6 @@ load_auditor_reserve_summary (struct ReserveSummary *rs)
uint64_t rowid;
qs = TALER_ARL_adb->get_reserve_info (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&rowid,
@@ -1255,7 +1254,6 @@ verify_reserve_balance (void *cls,
TALER_B2S (&rs->reserve_pub),
TALER_amount2s (&nbalance));
qs = TALER_ARL_adb->del_reserve_info (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub);
if (0 >= qs)
@@ -1282,7 +1280,6 @@ verify_reserve_balance (void *cls,
TALER_amount2s (&nbalance));
if (rs->had_ri)
qs = TALER_ARL_adb->update_reserve_info (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&nbalance,
@@ -1290,7 +1287,6 @@ verify_reserve_balance (void *cls,
rs->a_expiration_date);
else
qs = TALER_ARL_adb->insert_reserve_info (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&rs->reserve_pub,
&TALER_ARL_master_pub,
&nbalance,
@@ -1333,7 +1329,6 @@ analyze_reserves (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Analyzing reserves\n");
qsp = TALER_ARL_adb->get_auditor_progress_reserve (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
if (0 > qsp)
@@ -1358,7 +1353,6 @@ analyze_reserves (void *cls)
}
rc.qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
qsx = TALER_ARL_adb->get_reserve_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@@ -1427,7 +1421,6 @@ analyze_reserves (void *cls)
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qsx)
{
qs = TALER_ARL_adb->insert_reserve_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@@ -1435,7 +1428,6 @@ analyze_reserves (void *cls)
else
{
qs = TALER_ARL_adb->update_reserve_summary (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&total_escrow_balance,
&total_withdraw_fee_income);
@@ -1447,12 +1439,10 @@ analyze_reserves (void *cls)
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsp)
qs = TALER_ARL_adb->update_auditor_progress_reserve (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
else
qs = TALER_ARL_adb->insert_auditor_progress_reserve (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&ppr);
if (0 >= qs)
diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c
index 13ee27b70..2cd076ac9 100644
--- a/src/auditor/taler-helper-auditor-wire.c
+++ b/src/auditor/taler-helper-auditor-wire.c
@@ -663,8 +663,7 @@ commit (enum GNUNET_DB_QueryStatus qs)
else
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Hard error, not recording progress\n");
- TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
return qs;
}
@@ -691,7 +690,6 @@ commit (enum GNUNET_DB_QueryStatus qs)
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == wa->qsx)
qs = TALER_ARL_adb->update_wire_auditor_account_progress (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@@ -700,7 +698,6 @@ commit (enum GNUNET_DB_QueryStatus qs)
else
qs = TALER_ARL_adb->insert_wire_auditor_account_progress (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@@ -719,12 +716,10 @@ commit (enum GNUNET_DB_QueryStatus qs)
NULL);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qsx_gwap)
qs = TALER_ARL_adb->update_wire_auditor_progress (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
else
qs = TALER_ARL_adb->insert_wire_auditor_progress (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
if (0 >= qs)
@@ -746,13 +741,11 @@ commit (enum GNUNET_DB_QueryStatus qs)
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Exchange DB commit failed, rolling back transaction\n");
- TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
}
else
{
- qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ qs = TALER_ARL_adb->commit (TALER_ARL_adb->cls);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
@@ -765,8 +758,7 @@ commit (enum GNUNET_DB_QueryStatus qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing failed, rolling back transaction\n");
- TALER_ARL_adb->rollback (TALER_ARL_adb->cls,
- TALER_ARL_asession);
+ TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
}
return qs;
@@ -1947,23 +1939,22 @@ reserve_closed_cb (void *cls,
static enum GNUNET_DB_QueryStatus
begin_transaction (void)
{
- if (GNUNET_OK !=
+ if (GNUNET_SYSERR ==
TALER_ARL_edb->preflight (TALER_ARL_edb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize exchange database connection.\n");
return GNUNET_DB_STATUS_HARD_ERROR;
}
- TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls);
- if (NULL == TALER_ARL_asession)
+ if (GNUNET_SYSERR ==
+ TALER_ARL_adb->preflight (TALER_ARL_adb->cls))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to initialize auditor database session.\n");
return GNUNET_DB_STATUS_HARD_ERROR;
}
if (GNUNET_OK !=
- TALER_ARL_adb->start (TALER_ARL_adb->cls,
- TALER_ARL_asession))
+ TALER_ARL_adb->start (TALER_ARL_adb->cls))
{
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
@@ -1982,7 +1973,6 @@ begin_transaction (void)
{
wa->qsx = TALER_ARL_adb->get_wire_auditor_account_progress (
TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
wa->ai->section_name,
&wa->pp,
@@ -1996,7 +1986,6 @@ begin_transaction (void)
wa->start_pp = wa->pp;
}
qsx_gwap = TALER_ARL_adb->get_wire_auditor_progress (TALER_ARL_adb->cls,
- TALER_ARL_asession,
&TALER_ARL_master_pub,
&pp);
if (0 > qsx_gwap)