FIx loading pairs-list

This commit is contained in:
Matthias
2019-08-21 06:58:56 +02:00
parent eebf39a1df
commit 75b2db4424
2 changed files with 11 additions and 8 deletions

View File

@@ -346,10 +346,9 @@ class Configuration(object):
# or if pairs file is specified explicitely
if not pairs_file.exists():
raise OperationalException(f'No pairs file found with path "{pairs_file}".')
config['pairs'] = json_load(pairs_file)
config['pairs'].sort()
with pairs_file.open('r') as f:
config['pairs'] = json_load(f)
config['pairs'].sort()
return
if "config" in self.args and self.args.config:
@@ -357,7 +356,10 @@ class Configuration(object):
config['pairs'] = config.get('exchange', {}).get('pair_whitelist')
else:
# Fall back to /dl_path/pairs.json
pairs_file = Path(config['datadir']) / "pairs.json"
pairs_file = Path(config['datadir']) / config['exchange']['name'].lower() / "pairs.json"
print(config['datadir'])
if pairs_file.exists():
config['pairs'] = json_load(pairs_file)
config['pairs'].sort()
with pairs_file.open('r') as f:
config['pairs'] = json_load(f)
if 'pairs' in config:
config['pairs'].sort()