summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-15 20:08:38 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-15 20:08:38 +0100
commit4322bbf2f1722b4c53114901768772dabdb7e822 (patch)
treee2193282c2d179f2d3bdf32eb7aca7a6ba161f25 /src/exchange
parentd7cfb11fc6a171ece9c233d67ec849ac391bc818 (diff)
downloadexchange-4322bbf2f1722b4c53114901768772dabdb7e822.tar.gz
exchange-4322bbf2f1722b4c53114901768772dabdb7e822.tar.bz2
exchange-4322bbf2f1722b4c53114901768772dabdb7e822.zip
move common logic to parse currency into libtalerutil
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd.c25
-rw-r--r--src/exchange/taler-exchange-wirewatch.c47
2 files changed, 12 insertions, 60 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 98d6a9ba5..9524c2cbf 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -759,31 +759,6 @@ exchange_serve_process_config ()
return GNUNET_SYSERR;
}
{
- char *currency_string;
-
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "taler",
- "CURRENCY",
- &currency_string))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "taler",
- "CURRENCY");
- return GNUNET_SYSERR;
- }
- if (strlen (currency_string) >= TALER_CURRENCY_LEN)
- {
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "taler",
- "CURRENCY",
- "Value is too long");
- GNUNET_free (currency_string);
- return GNUNET_SYSERR;
- }
- GNUNET_free (currency_string);
- }
- {
char *master_public_key_str;
if (GNUNET_OK !=
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index 69929e127..3731f6633 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -101,11 +101,6 @@ static struct GNUNET_CURL_Context *ctx;
static struct GNUNET_CURL_RescheduleContext *rc;
/**
- * Which currency is used by this exchange?
- */
-static char *exchange_currency_string;
-
-/**
* The exchange's configuration (global)
*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -177,8 +172,6 @@ static struct TALER_BANK_CreditHistoryHandle *hh;
static void
shutdown_task (void *cls)
{
- struct WireAccount *wa;
-
(void) cls;
if (NULL != hh)
{
@@ -202,14 +195,18 @@ shutdown_task (void *cls)
}
TALER_EXCHANGEDB_plugin_unload (db_plugin);
db_plugin = NULL;
- while (NULL != (wa = wa_head))
{
- GNUNET_CONTAINER_DLL_remove (wa_head,
- wa_tail,
- wa);
- TALER_BANK_auth_free (&wa->auth);
- GNUNET_free (wa->section_name);
- GNUNET_free (wa);
+ struct WireAccount *wa;
+
+ while (NULL != (wa = wa_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (wa_head,
+ wa_tail,
+ wa);
+ TALER_BANK_auth_free (&wa->auth);
+ GNUNET_free (wa->section_name);
+ GNUNET_free (wa);
+ }
}
wa_pos = NULL;
last_row_off = 0;
@@ -259,28 +256,8 @@ add_account_cb (void *cls,
* @return #GNUNET_OK on success
*/
static int
-exchange_serve_process_config ()
+exchange_serve_process_config (void)
{
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "taler",
- "CURRENCY",
- &exchange_currency_string))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "taler",
- "CURRENCY");
- return GNUNET_SYSERR;
- }
- if (strlen (exchange_currency_string) >= TALER_CURRENCY_LEN)
- {
- fprintf (stderr,
- "Currency `%s' longer than the allowed limit of %u characters.",
- exchange_currency_string,
- (unsigned int) TALER_CURRENCY_LEN);
- return GNUNET_SYSERR;
- }
-
if (NULL ==
(db_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{