bug: fix LookupError with AntminerOld
This commit is contained in:
@@ -598,6 +598,7 @@ 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,7 +611,9 @@ class AntminerOld(CGMiner):
|
|||||||
if board_offset == -1:
|
if board_offset == -1:
|
||||||
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(
|
hashboard = HashBoard(
|
||||||
slot=i - board_offset, expected_chips=self.expected_chips
|
slot=i - board_offset, expected_chips=self.expected_chips
|
||||||
)
|
)
|
||||||
@@ -636,6 +639,11 @@ 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:
|
||||||
|
return [
|
||||||
|
HashBoard(slot=i, expected_chips=self.expected_chips)
|
||||||
|
for i in range(self.expected_hashboards)
|
||||||
|
]
|
||||||
|
|
||||||
return hashboards
|
return hashboards
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user