From 50ccfec1b3f0a6107397af003c13a3fe1871ed13 Mon Sep 17 00:00:00 2001 From: Arceris Date: Thu, 18 Aug 2022 10:12:19 -0600 Subject: [PATCH] Add a check in _parse_type_from_version (#16) --- pyasic/miners/miner_factory.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyasic/miners/miner_factory.py b/pyasic/miners/miner_factory.py index 68e3e06b..bbbbecd9 100644 --- a/pyasic/miners/miner_factory.py +++ b/pyasic/miners/miner_factory.py @@ -569,7 +569,12 @@ class MinerFactory(metaclass=Singleton): # if all that fails, check the Description to see if it is a whatsminer if version.get("Description") and ("whatsminer" in version.get("Description")): api = "BTMiner" - + + # If version does not exist in the keys, return None (resulting in Unknown). + # Prevents halting on suspended miners that aren't returning valid information. + if "VERSION" not in version.keys(): + return None, None, None + # check for avalonminers if version["VERSION"][0].get("PROD"): _data = version["VERSION"][0]["PROD"].split("-")