Bugfix: Hashrate incorrect

This commit is contained in:
joshuayabut 2016-12-22 04:27:02 +00:00
parent 600881e993
commit 57617f106c
3 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@
"port": 80,
"stratumHost": "cryppit.com",
"stats": {
"updateInterval": 60,
"updateInterval": 30,
"historicalRetention": 43200,
"hashrateWindow": 300
},

View File

@ -274,9 +274,9 @@ module.exports = function(logger, portalConfig, poolConfigs){
var i = -1;
var byteUnits = [ ' Sol',' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
do {
hashrate = hashrate / 1024;
hashrate = (hashrate * 2) / 1000000;
i++;
} while (hashrate > 1024);
} while (hashrate > 1000);
return hashrate.toFixed(2) + byteUnits[i];
};

View File

@ -70,11 +70,11 @@ function buildChartData(){
function getReadableHashRateString(hashrate){
var i = -1;
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol' ];
var byteUnits = [ ' Sol',' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
do {
hashrate = hashrate / 1024;
hashrate = (hashrate * 2) / 1000000;
i++;
} while (hashrate > 1024);
} while (hashrate > 1000);
return Math.round(hashrate) + byteUnits[i];
}