aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/exchangedb_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/exchangedb_plugin.c')
-rw-r--r--src/exchangedb/exchangedb_plugin.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/exchangedb/exchangedb_plugin.c b/src/exchangedb/exchangedb_plugin.c
index 68a916b4e..747a2ad1b 100644
--- a/src/exchangedb/exchangedb_plugin.c
+++ b/src/exchangedb/exchangedb_plugin.c
@@ -25,7 +25,8 @@
struct TALER_EXCHANGEDB_Plugin *
-TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
+TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ bool skip_preflight)
{
char *plugin_name;
char *lib_name;
@@ -52,6 +53,15 @@ TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
plugin->library_name = lib_name;
else
GNUNET_free (lib_name);
+ if ( (! skip_preflight) &&
+ (GNUNET_OK !=
+ plugin->preflight (plugin->cls)) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Database not ready. Try running taler-exchange-dbinit!\n");
+ TALER_EXCHANGEDB_plugin_unload (plugin);
+ return NULL;
+ }
return plugin;
}