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