diff --git a/config_example.json b/config_example.json index 7c070264..78d1944c 100644 --- a/config_example.json +++ b/config_example.json @@ -1,6 +1,7 @@ { "pool_id": 0, "eth_pool_support": 1, + "worker_num": 0, "bind_ip": "127.0.0.1", "hostname": "testpool.com", "db_storage_path": "CHANGEME", diff --git a/lib/pool.js b/lib/pool.js index 2599cc35..f979b52d 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -2327,7 +2327,7 @@ function getUniqueWorkerID(cb) { } if (cluster.isMaster) { - const numWorkers = require('os').cpus().length; + const numWorkers = global.config.worker_num ? global.config.worker_num : require('os').cpus().length; for (let i = 1; i <= numWorkers; ++ i) { minerCount[i] = []; global.config.ports.forEach(function (portData) {