bug: fix an issue with missing a check for bosminer config when getting data.

This commit is contained in:
UpstreamData
2023-02-28 16:23:04 -07:00
parent 6be1e94216
commit e9bcf2ec9f

View File

@@ -690,14 +690,15 @@ class BOSMiner(BaseMiner):
# need to use get_config, as this will never read perfectly as there are some bad edge cases # need to use get_config, as this will never read perfectly as there are some bad edge cases
groups = [] groups = []
cfg = await self.get_config() cfg = await self.get_config()
for group in cfg.pool_groups: if cfg:
pools = {"quota": group.quota} for group in cfg.pool_groups:
for _i, _pool in enumerate(group.pools): pools = {"quota": group.quota}
pools[f"pool_{_i + 1}_url"] = _pool.url.replace( for _i, _pool in enumerate(group.pools):
"stratum+tcp://", "" pools[f"pool_{_i + 1}_url"] = _pool.url.replace(
).replace("stratum2+tcp://", "") "stratum+tcp://", ""
pools[f"pool_{_i + 1}_user"] = _pool.username ).replace("stratum2+tcp://", "")
groups.append(pools) pools[f"pool_{_i + 1}_user"] = _pool.username
groups.append(pools)
return groups return groups
else: else:
groups[0][f"pool_{i + 1}_url"] = ( groups[0][f"pool_{i + 1}_url"] = (