Check if added pair has correct stake-currency

This commit is contained in:
Matthias 2019-03-25 19:40:21 +01:00
parent 01c4f243d4
commit f26ed1c8c1

View File

@ -464,10 +464,14 @@ class RPC(object):
def _rpc_blacklist(self, add: List[str]) -> Dict: def _rpc_blacklist(self, add: List[str]) -> Dict:
""" Returns the currently active blacklist""" """ Returns the currently active blacklist"""
if add: if add:
self._freqtrade.pairlists.blacklist.extend(add) stake_currency = self._freqtrade.config.get('stake_currency')
for pair in add:
if (pair.endswith(stake_currency)
and pair not in self._freqtrade.pairlists.blacklist):
self._freqtrade.pairlists.blacklist.append(pair)
res = {'method': self._freqtrade.pairlists.name, res = {'method': self._freqtrade.pairlists.name,
'length': len(self._freqtrade.pairlists.blacklist), 'length': len(self._freqtrade.pairlists.blacklist),
'blacklist': self._freqtrade.pairlists.blacklist 'blacklist': self._freqtrade.pairlists.blacklist,
} }
return res return res