Fix pool settings config

This commit is contained in:
Michele Marcucci 2021-05-09 09:14:04 +02:00
parent 1910eb9364
commit 96d7e788da

View File

@ -72,9 +72,11 @@ const generate = async function (pools = null, settings = null ) {
const fanLow = (settings.fan_low && settings.fan_low !== 40) ? `-fan_temp_low ${settings.fan_low}` : null;
const fanHigh = (settings.fan_high && settings.fan_high !== 60) ? `-fan_temp_hi ${settings.fan_high}` : null;
const poolUrl = new URL(mainPool.url);
const poolUrl = mainPool.url.replace(/^.*\/\//, '');
let minerConfig = `-host ${poolUrl.hostname} -port ${poolUrl.port} -user ${mainPool.username} -brd_ocp ${voltage} -osc ${frequency}`;
const [poolHost, poolPort] = poolUrl.split(':');
let minerConfig = `-host ${poolHost} -port ${poolPort} -user ${mainPool.username} -brd_ocp ${voltage} -osc ${frequency}`;
if (fanLow) minerConfig += ` ${fanLow}`;
if (fanHigh) minerConfig += ` ${fanHigh}`;