Skip to content

Commit a572fed

Browse files
committed
bug: fix some cases where bosminer config could be invalid
1 parent 6c46a7c commit a572fed

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyasic/config/mining/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def as_mara(self) -> dict:
8282
def as_luxos(self) -> dict:
8383
return {"autotunerset": {"enabled": False}}
8484

85+
def as_bosminer(self) -> dict:
86+
return {"autotuning": {"enabled": True}}
87+
8588

8689
class MiningModeSleep(MinerConfigValue):
8790
mode: str = field(init=False, default="sleep")
@@ -692,6 +695,7 @@ def from_bosminer(cls, toml_conf: dict):
692695
return cls.hashrate_tuning(
693696
scaling=ScalingConfig.from_bosminer(toml_conf, mode="hashrate"),
694697
)
698+
return cls.default()
695699

696700
@classmethod
697701
def from_vnish(cls, web_settings: dict, web_presets: list[dict]):

pyasic/config/pools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def from_bosminer(cls, toml_pool_conf: dict) -> "Pool":
190190
return cls(
191191
url=toml_pool_conf["url"],
192192
user=toml_pool_conf["user"],
193-
password=toml_pool_conf["password"],
193+
password=toml_pool_conf.get("password", ""),
194194
)
195195

196196
@classmethod

0 commit comments

Comments
 (0)