bug: fix sending privileged commands on BTMiner using timeout as the port, and capture positional arguments in _send_bytes to prevent this.
This commit is contained in:
@@ -196,6 +196,7 @@ If you are sure you want to use this command please use API.send_command("{comma
|
|||||||
async def _send_bytes(
|
async def _send_bytes(
|
||||||
self,
|
self,
|
||||||
data: bytes,
|
data: bytes,
|
||||||
|
*,
|
||||||
port: int = None,
|
port: int = None,
|
||||||
timeout: int = 100,
|
timeout: int = 100,
|
||||||
) -> bytes:
|
) -> bytes:
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class BTMinerRPCAPI(BaseMinerRPCAPI):
|
|||||||
|
|
||||||
logging.debug(f"{self} - (Send Privileged Command) - Sending")
|
logging.debug(f"{self} - (Send Privileged Command) - Sending")
|
||||||
try:
|
try:
|
||||||
data = await self._send_bytes(enc_command, timeout)
|
data = await self._send_bytes(enc_command, timeout=timeout)
|
||||||
except (asyncio.CancelledError, asyncio.TimeoutError):
|
except (asyncio.CancelledError, asyncio.TimeoutError):
|
||||||
if ignore_errors:
|
if ignore_errors:
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
Reference in New Issue
Block a user