aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/taler-helper-auditor-wire-debit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditor/taler-helper-auditor-wire-debit.c')
-rw-r--r--src/auditor/taler-helper-auditor-wire-debit.c53
1 files changed, 9 insertions, 44 deletions
diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c
index c01befc47..56ee9e5cd 100644
--- a/src/auditor/taler-helper-auditor-wire-debit.c
+++ b/src/auditor/taler-helper-auditor-wire-debit.c
@@ -56,8 +56,6 @@
/**
* Run in test mode. Exit when idle instead of
* going to sleep and waiting for more work.
- *
- * FIXME: not yet implemented!
*/
static int test_mode;
@@ -279,11 +277,6 @@ static int ignore_account_404;
static struct GNUNET_DB_EventHandler *eh;
/**
- * Our database plugin.
- */
-static struct TALER_AUDITORDB_Plugin *db_plugin;
-
-/**
* The auditors's configuration.
*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -373,15 +366,10 @@ do_shutdown (void *cls)
(void) cls;
if (NULL != eh)
{
- db_plugin->event_listen_cancel (eh);
+ TALER_ARL_adb->event_listen_cancel (eh);
eh = NULL;
}
- if (NULL != db_plugin)
- {
- TALER_AUDITORDB_plugin_unload (db_plugin);
- db_plugin = NULL;
- }
- TALER_ARL_done (NULL);
+ TALER_ARL_done ();
if (NULL != reserve_closures)
{
GNUNET_CONTAINER_multihashmap_iterate (reserve_closures,
@@ -1135,8 +1123,6 @@ wire_out_cb (void *cls,
TALER_ARL_amount_add (&TALER_ARL_USE_AB (total_bad_amount_out_minus),
&TALER_ARL_USE_AB (total_bad_amount_out_minus),
amount);
- if (TALER_ARL_do_abort ())
- return GNUNET_SYSERR;
return GNUNET_OK;
}
if (0 != strcasecmp (payto_uri,
@@ -1230,8 +1216,6 @@ wire_out_cb (void *cls,
&key,
roi));
wa->last_wire_out_serial_id = rowid + 1;
- if (TALER_ARL_do_abort ())
- return GNUNET_SYSERR;
return ret;
}
@@ -1754,8 +1738,6 @@ reserve_closed_cb (void *cls,
return GNUNET_OK;
}
GNUNET_free (rc);
- if (TALER_ARL_do_abort ())
- return GNUNET_SYSERR;
return GNUNET_OK;
}
TALER_ARL_USE_PP (wire_reserve_close_id)
@@ -1772,8 +1754,6 @@ reserve_closed_cb (void *cls,
&key,
rc,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
- if (TALER_ARL_do_abort ())
- return GNUNET_SYSERR;
return GNUNET_OK;
}
@@ -1998,6 +1978,7 @@ db_notify (void *cls,
GNUNET_break (0);
global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown ();
+ return;
}
}
@@ -2032,23 +2013,6 @@ run (void *cls,
reserve_closures
= GNUNET_CONTAINER_multihashmap_create (1024,
GNUNET_NO);
- if (NULL ==
- (db_plugin = TALER_AUDITORDB_plugin_load (cfg)))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to initialize DB subsystem\n");
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- if (GNUNET_OK !=
- db_plugin->preflight (db_plugin->cls))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to connect to database\n");
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
-
if (GNUNET_OK !=
TALER_config_get_amount (TALER_ARL_cfg,
"auditor",
@@ -2108,17 +2072,18 @@ run (void *cls,
TALER_EXCHANGEDB_find_accounts (&process_account_cb,
NULL);
+ if (0 == test_mode)
{
struct GNUNET_DB_EventHeaderP es = {
.size = htons (sizeof (es)),
.type = htons (TALER_DBEVENT_EXCHANGE_AUDITOR_WAKE_HELPER_WIRE)
};
- eh = db_plugin->event_listen (db_plugin->cls,
- &es,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &db_notify,
- NULL);
+ eh = TALER_ARL_adb->event_listen (TALER_ARL_adb->cls,
+ &es,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &db_notify,
+ NULL);
GNUNET_assert (NULL != eh);
}
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=