bug: fix AntminerOld board parsing

This commit is contained in:
Upstream Data
2024-10-30 14:37:19 -06:00
parent c3ab814d77
commit 275d87e4fe

View File

@@ -597,7 +597,6 @@ class AntminerOld(CGMiner):
pass
if rpc_stats is not None:
try:
board_offset = -1
boards = rpc_stats["STATS"]
if len(boards) > 1:
@@ -610,9 +609,7 @@ class AntminerOld(CGMiner):
if board_offset == -1:
board_offset = 1
for i in range(
board_offset, board_offset + self.expected_hashboards
):
for i in range(board_offset, board_offset + self.expected_hashboards):
hashboard = HashBoard(
slot=i - board_offset, expected_chips=self.expected_chips
)
@@ -628,7 +625,7 @@ class AntminerOld(CGMiner):
hashrate = boards[1].get(f"chain_rate{i}")
if hashrate:
hashboard.hashrate = AlgoHashRate.SHA256(
hashrate, HashUnit.SHA256.GH
float(hashrate), HashUnit.SHA256.GH
).into(self.algo.unit.default)
chips = boards[1].get(f"chain_acn{i}")
@@ -638,8 +635,6 @@ class AntminerOld(CGMiner):
if (not chips) or (not chips > 0):
hashboard.missing = True
hashboards.append(hashboard)
except (LookupError, ValueError, TypeError):
pass
return hashboards