bug: fix a bug with MinerAPI.commands causing an infinite recursion loop when checking a list of commands with get_commands, and ficx some weirdness where BTMiner doesnt return any data.

This commit is contained in:
UpstreamData
2022-12-02 09:26:17 -07:00
parent 151a4f6c2d
commit c41324b324
2 changed files with 3 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ class BaseMinerAPI:
for func in
# each function in self
dir(self)
if not func == "commands"
if callable(getattr(self, func)) and
# no __ or _ methods
not func.startswith("__") and not func.startswith("_") and

View File

@@ -198,6 +198,8 @@ class BTMinerAPI(BaseMinerAPI):
enc_command = create_privileged_cmd(token_data, command)
data = await self._send_bytes(enc_command)
if not data:
raise APIError("No data was returned from the API.")
data = self._load_api_data(data)
try: