From 2ebcec91c00e0e5cd7e348e491ee62330364f3c7 Mon Sep 17 00:00:00 2001 From: Didrole Date: Wed, 1 Mar 2017 12:07:51 +0100 Subject: [PATCH 1/2] Send RPC id with jobs. --- lib/pool.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pool.js b/lib/pool.js index 922f32b..856a87d 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -457,7 +457,8 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer this.cachedJob = { blob: blob, job_id: newJob.id, - target: target + target: target, + id: this.id }; return this.cachedJob; }; From 82fcd2e1a98c8eda07605c52164272972612d7d7 Mon Sep 17 00:00:00 2001 From: Didrole Date: Wed, 1 Mar 2017 12:15:45 +0100 Subject: [PATCH 2/2] Allow miners to not specify an agent. Because xmr-proxy doesn't relay the agent. https://github.com/Atrides/xmr-proxy/blob/master/mining_libs/stratum_listener.py#L167 --- lib/pool.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pool.js b/lib/pool.js index 856a87d..e4c7fef 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -195,7 +195,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer let pass_split = pass.split(":"); this.error = ""; this.identifier = pass_split[0]; - if (agent.includes('MinerGate')){ + if (agent && agent.includes('MinerGate')){ this.identifier = "MinerGate"; } this.paymentID = null; @@ -224,7 +224,7 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer this.fixed_diff = false; this.difficulty = startingDiff; this.connectTime = Date.now(); - if (agent.includes('NiceHash')){ + if (agent && agent.includes('NiceHash')){ this.fixed_diff = true; this.difficulty = global.coinFuncs.niceHashDiff; } @@ -581,7 +581,7 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage) { } switch (method) { case 'login': - if (!params.login || (!params.pass && !params.agent.includes('MinerGate'))) { + if (!params.login || (!params.pass && params.agent && !params.agent.includes('MinerGate'))) { sendReply("No login/password specified"); return; }