From 7f268817454ae37b68dd823f66094ba4cc4c5b1b Mon Sep 17 00:00:00 2001 From: Robert Piotrowski <50244265+revoxhere@users.noreply.github.com> Date: Sat, 10 Sep 2022 21:36:06 +0200 Subject: [PATCH 1/5] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 6b525b5..6fcc0cd 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "node-os-utils": "^1.3.5", "xxhashjs": "^0.2.2", "chalk": "4.1.2", + "sync-request": "^6.1.0", "form-data": "4.0.0" } } From 837a0fae9876678ddd1971954d3aed9253121da4 Mon Sep 17 00:00:00 2001 From: Robert Piotrowski <50244265+revoxhere@users.noreply.github.com> Date: Mon, 12 Sep 2022 19:06:33 +0200 Subject: [PATCH 2/5] Update mining.js --- src/mining.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mining.js b/src/mining.js index b430069..7b2e136 100755 --- a/src/mining.js +++ b/src/mining.js @@ -24,6 +24,7 @@ globalBlocks = []; let workers = {}; let usrWorkers = {}; let minersStats = {}; +let cachedItems = {}; let balancesToUpdate = {}; let globalShares = { increase: 0, @@ -47,8 +48,13 @@ const checkWorkers = (ipWorkers, usrWorkers, serverMiners, username) => { if (Math.max(ipWorkers, usrWorkers, serverMiners) > maxWorkers) { /* Check if user has worker limit upgrades */ - res = request('GET', `https://server.duinocoin.com/v2/users/${username}`) - userItems = JSON.parse(res.getBody('utf8')).result.items; + if (!cachedItems.hasOwnProperty(username) && getRand(50) != 10) { + res = request('GET', `https://server.duinocoin.com/v2/users/${username}`) + userItems = JSON.parse(res.getBody('utf8')).result.items; + cachedItems[username] = userItems; + } else { + userItems = cachedItems[username]; + } if (userItems.includes(10) && userItems.includes(11)) { if (Math.max(ipWorkers, usrWorkers, serverMiners) > 125) { From af54062003e3cd7bcd44fb70569f4338ad0c97db Mon Sep 17 00:00:00 2001 From: Robert Piotrowski <50244265+revoxhere@users.noreply.github.com> Date: Thu, 29 Dec 2022 11:56:00 +0100 Subject: [PATCH 3/5] Update mining.js --- src/mining.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mining.js b/src/mining.js index 7b2e136..b920503 100755 --- a/src/mining.js +++ b/src/mining.js @@ -1,7 +1,7 @@ /* Duino-Coin Mining handler For documention about these functions see https://github.com/revoxhere/duino-coin/blob/useful-tools -2019-2022 Duino-Coin community */ +2019-2023 Duino-Coin community */ const crypto = require("crypto"); const request = require('sync-request'); @@ -31,7 +31,7 @@ let globalShares = { total: 0, }; if (!max_shares_per_minute) { - let max_shares_per_minute = 70; + let max_shares_per_minute = 80; } const getDiff = (poolRewards, textDiff) => { @@ -156,8 +156,6 @@ const miningHandler = async (conn, data, mainListener, usingAVR) => { data = data.split(","); conn.ping = (new Date() - feedback_sent) / 1000; - if (data[1] != username) conn.reject_shares = "Username changed"; - if (conn.overrideDifficulty) reqDifficulty = conn.overrideDifficulty; else if (usingAVR) reqDifficulty = "AVR"; From e9bb048c10b495e4ed9960633b9dc2abdd2c3e38 Mon Sep 17 00:00:00 2001 From: Reinos Date: Wed, 22 Nov 2023 20:17:34 +0100 Subject: [PATCH 4/5] (fix): unscoped miner_res variable It seems that the `miner_res` variable is not scoped via `let` or `const` keyword. It is simply defined dynamically. This way the `miner_res` variable is defined as a global variable. As a result, it could happend when 2 devices are reporting at the same time, the `miner_res` variable is overridden by the next request and let the first request fail because it has simply the wrong (result of the last request) `miner_res` variable. --- src/mining.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mining.js b/src/mining.js index b920503..a7bf0fa 100755 --- a/src/mining.js +++ b/src/mining.js @@ -251,10 +251,9 @@ const miningHandler = async (conn, data, mainListener, usingAVR) => { conn.lastminshares++; + let miner_res = parseInt(answer[0]); if (usingAVR) { miner_res = parseInt(answer[0], 2); - } else { - miner_res = parseInt(answer[0]); } /* try { From f9bbbafc1a64a7b1cb793a3b91e522d31617aa62 Mon Sep 17 00:00:00 2001 From: Bilaboz <44091093+Bilaboz@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:24:05 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41730c0..0ac5ad2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Welcome to duino-pools 👋

+

Welcome to duino-coin-pools 👋

Maintenance