diff --git a/config/config.go b/config/config.go index 749859b2..0e873aa4 100644 --- a/config/config.go +++ b/config/config.go @@ -205,10 +205,19 @@ func (c *Config) CheckWebserverConfigValues() error { return nil } -func (c *Config) RetrieveConfigCurrencyPairs() { +func (c *Config) RetrieveConfigCurrencyPairs() error { cryptoCurrencies := common.SplitStrings(c.Cryptocurrencies, ",") fiatCurrencies := common.SplitStrings(currency.DEFAULT_CURRENCIES, ",") + for _, s := range cryptoCurrencies { + _, err := strconv.Atoi(s) + if err != nil && common.StringContains(c.Cryptocurrencies, s) { + continue + } else { + return errors.New("RetrieveConfigCurrencyPairs: Incorrect Crypto-Currency") + } + } + for _, exchange := range c.Exchanges { if exchange.Enabled { baseCurrencies := common.SplitStrings(exchange.BaseCurrencies, ",") @@ -252,6 +261,8 @@ func (c *Config) RetrieveConfigCurrencyPairs() { } c.Cryptocurrencies = common.JoinStrings(cryptoCurrencies, ",") currency.CryptoCurrencies = c.Cryptocurrencies + + return nil } func (c *Config) ReadConfig() error {