From 4e3beaf66d3a4b025f98d39a688b68b0c302eb7f Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sun, 12 Feb 2023 09:07:06 +1100 Subject: [PATCH] use 2 threads at least --- src/js/challenge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/challenge.js b/src/js/challenge.js index 4dcd4de..9c7138f 100644 --- a/src/js/challenge.js +++ b/src/js/challenge.js @@ -113,7 +113,7 @@ const powFinished = new Promise(resolve => { const isTor = location.hostname.endsWith('.onion'); /* Try to use all threads on tor, because tor limits threads for anti fingerprinting but this makes it awfully slow because workerThreads will always be = 1 */ - const workerThreads = isTor ? cpuThreads : Math.max(Math.ceil(cpuThreads/2),cpuThreads-1); + const workerThreads = (isTor || cpuThreads === 2) ? cpuThreads : Math.max(Math.ceil(cpuThreads/2),cpuThreads-1); const messageHandler = (e) => { if (e.data.length === 1) { const totalHashes = e.data[0]; //assumes all worker threads are same speed