From 85e9b357bb9fec840a736ba609527a3e45262207 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf <1028334+nikhilsaraf@users.noreply.github.com> Date: Wed, 31 Jul 2019 00:44:43 -0700 Subject: [PATCH] Kelp UI: validate dynamically retrieved values from CCXT before adding to the optionsMetadata addresses part of issue #67 --- gui/backend/options_metadata.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/backend/options_metadata.go b/gui/backend/options_metadata.go index aeb22df6b..a4dd84bb1 100644 --- a/gui/backend/options_metadata.go +++ b/gui/backend/options_metadata.go @@ -196,6 +196,11 @@ func loadOptionsMetadata() (metadata, error) { marketsBuilder := optionsBuilder() for tradingPair := range c.GetMarkets() { + if strings.Count(tradingPair, "/") != 1 { + log.Printf("ignoring ccxt exchange market for tradingPair on '%s' exchange because there was not exactly one '/' in the tradingPair: %s", ccxtExchangeName, tradingPair) + continue + } + marketsBuilder.ccxtMarket(tradingPair) } ccxtOptions.option("ccxt-"+ccxtExchangeName, displayName, dropdown(marketsBuilder))