Verify blacklist correctly

This commit is contained in:
Matthias 2019-11-09 07:23:34 +01:00
parent eaf3fd80c5
commit 31c7189b8b
2 changed files with 13 additions and 4 deletions

View File

@ -57,14 +57,22 @@ class IPairList(ABC):
"""
@staticmethod
def _verify_blacklist(self, pairlist: List[str]) -> List[str]:
def verify_blacklist(self, pairlist: List[str], blacklist: List[str]) -> List[str]:
"""
Verify and remove items from pairlist - returning a filtered pairlist.
"""
for pair in deepcopy(pairlist):
if pair in self._pairlistmanager.blacklist:
if pair in blacklist:
logger.warning(f"Pair {pair} in your blacklist. Removing it from whitelist...")
pairlist.remove(pair)
return pairlist
def _verify_blacklist(self, pairlist: List[str]) -> List[str]:
"""
Proxy method to verify_blacklist for easy access for child classes.
"""
return IPairList.verify_blacklist(pairlist, self._pairlistmanager.blacklist)
def _whitelist_for_active_markets(self, whitelist: List[str]) -> List[str]:
"""
Check available markets and remove pair from whitelist if necessary

View File

@ -61,5 +61,6 @@ class PairListManager():
pairlist = pl.filter_pairlist(pairlist, tickers)
# Validation against blacklist happens after the pairlists to ensure blacklist is respected.
pairlist = self.verify_blacklist(pairlist, self.blacklist)
pairlist = IPairList.verify_blacklist(pairlist, self.blacklist)
self._whitelist = pairlist