Changed stats to use algo multiplier
This commit is contained in:
parent
167be4baf0
commit
e58689956d
|
@ -302,8 +302,8 @@ Description of options:
|
||||||
job broadcast. */
|
job broadcast. */
|
||||||
"txRefreshInterval": 20000,
|
"txRefreshInterval": 20000,
|
||||||
|
|
||||||
/* Some miner software is bugged and will consider the pool offline if it doesn't receive
|
/* Some miner apps will consider the pool dead/offline if it doesn't receive anything new jobs
|
||||||
anything for around a minute, so every time we broadcast jobs, set a timeout to rebroadcast
|
for around a minute, so every time we broadcast jobs, set a timeout to rebroadcast
|
||||||
in this many seconds unless we find a new job. Set to zero or remove to disable this. */
|
in this many seconds unless we find a new job. Set to zero or remove to disable this. */
|
||||||
"jobRebroadcastTimeout": 55,
|
"jobRebroadcastTimeout": 55,
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ module.exports = function(logger){
|
||||||
|
|
||||||
//Functions required for MPOS compatibility
|
//Functions required for MPOS compatibility
|
||||||
if (shareProcessing && shareProcessing.mpos && shareProcessing.mpos.enabled){
|
if (shareProcessing && shareProcessing.mpos && shareProcessing.mpos.enabled){
|
||||||
var mposCompat = new MposCompatibility(logger, poolOptions)
|
var mposCompat = new MposCompatibility(logger, poolOptions);
|
||||||
|
|
||||||
handlers.auth = function(workerName, password, authCallback){
|
handlers.auth = function(workerName, password, authCallback){
|
||||||
mposCompat.handleAuth(workerName, password, authCallback);
|
mposCompat.handleAuth(workerName, password, authCallback);
|
||||||
|
@ -135,7 +135,7 @@ module.exports = function(logger){
|
||||||
//Functions required for internal payment processing
|
//Functions required for internal payment processing
|
||||||
else if (shareProcessing && shareProcessing.internal && shareProcessing.internal.enabled){
|
else if (shareProcessing && shareProcessing.internal && shareProcessing.internal.enabled){
|
||||||
|
|
||||||
var shareProcessor = new ShareProcessor(logger, poolOptions)
|
var shareProcessor = new ShareProcessor(logger, poolOptions);
|
||||||
|
|
||||||
handlers.auth = function(workerName, password, authCallback){
|
handlers.auth = function(workerName, password, authCallback){
|
||||||
if (shareProcessing.internal.validateWorkerAddress !== true)
|
if (shareProcessing.internal.validateWorkerAddress !== true)
|
||||||
|
@ -215,7 +215,7 @@ module.exports = function(logger){
|
||||||
// on the last pool it was using when reloaded or restarted
|
// on the last pool it was using when reloaded or restarted
|
||||||
//
|
//
|
||||||
logger.debug(logSystem, logComponent, logSubCat, 'Loading last proxy state from redis');
|
logger.debug(logSystem, logComponent, logSubCat, 'Loading last proxy state from redis');
|
||||||
var redisClient = redis.createClient(portalConfig.redis.port, portalConfig.redis.host)
|
var redisClient = redis.createClient(portalConfig.redis.port, portalConfig.redis.host);
|
||||||
redisClient.on('ready', function(){
|
redisClient.on('ready', function(){
|
||||||
redisClient.hgetall("proxyState", function(error, obj) {
|
redisClient.hgetall("proxyState", function(error, obj) {
|
||||||
if (error || obj == null) {
|
if (error || obj == null) {
|
||||||
|
|
|
@ -191,7 +191,7 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
||||||
else
|
else
|
||||||
coinStats.workers[worker] = workerShares;
|
coinStats.workers[worker] = workerShares;
|
||||||
});
|
});
|
||||||
var shareMultiplier = algos[coinStats.algorithm].multiplier || 0;
|
var shareMultiplier = Math.pow(2, 32) / algos[coinStats.algorithm].multiplier;
|
||||||
var hashratePre = shareMultiplier * coinStats.shares / portalConfig.website.stats.hashrateWindow;
|
var hashratePre = shareMultiplier * coinStats.shares / portalConfig.website.stats.hashrateWindow;
|
||||||
coinStats.hashrate = hashratePre | 0;
|
coinStats.hashrate = hashratePre | 0;
|
||||||
coinStats.workerCount = Object.keys(coinStats.workers).length;
|
coinStats.workerCount = Object.keys(coinStats.workers).length;
|
||||||
|
|
Loading…
Reference in New Issue