diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-02-11 15:40:37 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-02-11 15:40:37 +0100 |
commit | 3ad698d01865c9f1b5c5aadc2f4d8b0a3658b81c (patch) | |
tree | 671de5acc0a13cafe636bf1e220496a5882a8b74 /src/bank-lib/taler-fakebank-run.c | |
parent | de0d987e34d426f6ed3593840078442191255587 (diff) | |
parent | cdaf1ce69b5fb56f09bbdc00942b03f039710614 (diff) | |
download | exchange-3ad698d01865c9f1b5c5aadc2f4d8b0a3658b81c.tar.xz |
merging
Diffstat (limited to 'src/bank-lib/taler-fakebank-run.c')
-rw-r--r-- | src/bank-lib/taler-fakebank-run.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/bank-lib/taler-fakebank-run.c b/src/bank-lib/taler-fakebank-run.c index 55b3da54f..588777c94 100644 --- a/src/bank-lib/taler-fakebank-run.c +++ b/src/bank-lib/taler-fakebank-run.c @@ -43,12 +43,38 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { + char *currency_string; + (void) cls; (void) args; (void) cfgfile; (void) cfg; - if (NULL == TALER_FAKEBANK_start (8082)) + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, + "taler", + "CURRENCY", + ¤cy_string)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "taler", + "CURRENCY"); + ret = 1; + return; + } + 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); + ret = 1; + return; + } + if (NULL == TALER_FAKEBANK_start (8082, + currency_string)) ret = 1; + GNUNET_free (currency_string); ret = 0; } |