From bd2372f20ef7259d87c44e92de32c66b26e6632f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 11 Apr 2015 16:38:09 +0200 Subject: implementing #3740 --- src/mint/taler-mint-httpd.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/mint/taler-mint-httpd.c') diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c index 1315ba204..dd1e234cb 100644 --- a/src/mint/taler-mint-httpd.c +++ b/src/mint/taler-mint-httpd.c @@ -36,6 +36,10 @@ #include "taler-mint-httpd_keystate.h" #include "taler_mintdb_plugin.h" +/** + * Which currency is used by this mint? + */ +char *TMH_mint_currency_string; /** * Base directory of the mint (global) @@ -248,9 +252,27 @@ mint_serve_process_config (const char *mint_directory) if (NULL == cfg) { fprintf (stderr, - "can't load mint configuration\n"); + "Failed to load mint configuration\n"); return 1; } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, + "mint", + "currency", + &TMH_mint_currency_string)) + { + fprintf (stderr, + "No currency given in mint configuration."); + return GNUNET_NO; + } + if (strlen (TMH_mint_currency_string) >= TALER_CURRENCY_LEN) + { + fprintf (stderr, + "Currency `%s' longer than the allowed limit of %u characters.", + TMH_mint_currency_string, + (unsigned int) TALER_CURRENCY_LEN); + return GNUNET_NO; + } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "mint", -- cgit v1.2.3