Fix NoneType

This commit is contained in:
seansan 2018-01-14 12:47:03 +01:00 committed by GitHub
parent 96081e20fe
commit 0a67334e77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,13 +48,15 @@ def refresh_whitelist(whitelist: List[str]) -> List[str]:
'Ignoring %s from whitelist (reason: %s).',
pair, status.get('Notice') or 'wallet is not active'
)
# Wallet will be delisted soon (and cause a loss)
if "delisted" in status['Notice']:
# Wallet is going to be delisted (and cause a loss)
delisted = 'delisted'
if delisted in str(status['Notice']):
sanitized_whitelist.remove(pair)
logger.info(
'Ignoring %s from whitelist (reason: %s).',
pair, status.get('Notice') or 'wallet will be delisted soon'
)
# We need to remove pairs that are unknown
final_list = [x for x in sanitized_whitelist if x in known_pairs]