commit 9251a2d5d243981d45dc956844f32619a6a64530
parent 7c96cb35514dd8170f2064da581880f30e0ca8d2
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 2 Dec 2015 11:09:54 +0100
use config consistently:
Diffstat:
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/backend/merchant.conf b/src/backend/merchant.conf
@@ -21,6 +21,7 @@ TRUSTED_MINTS = taler x
# FIXME: EDATE is a bit short, 'execution_delay'?
EDATE = 3 week
+# Which plugin (backend) do we use for the DB.
DB = postgres
[mint-taler]
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
@@ -38,11 +38,6 @@ struct PostgresClosure
*/
PGconn *conn;
- /**
- * Database connection string, as read from
- * the configuration.
- */
- char *connection_cfg_str;
};
@@ -211,17 +206,16 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
pg = GNUNET_new (struct PostgresClosure);
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "merchantdb-postgres",
- "CONFIG",
- &pg->connection_cfg_str))
+ GNUNET_CONFIGURATION_have_value_string (cfg,
+ "merchantdb-postgres",
+ "CONFIG"))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "merchant",
- "db_conn_str");
+ "merchantdb-postgres",
+ "CONFIG");
return NULL;
}
- pg->conn = GNUNET_POSTGRES_connect (cfg, "merchant-db");
+ pg->conn = GNUNET_POSTGRES_connect (cfg, "merchantdb-postgres");
plugin = GNUNET_new (struct TALER_MERCHANTDB_Plugin);
plugin->cls = pg;
plugin->initialize = &postgres_initialize;
@@ -243,7 +237,6 @@ libtaler_plugin_merchantdb_postgres_done (void *cls)
struct TALER_MERCHANTDB_Plugin *plugin = cls;
struct PostgresClosure *pg = plugin->cls;
- GNUNET_free (pg->connection_cfg_str);
PQfinish (pg->conn);
GNUNET_free (pg);
GNUNET_free (plugin);