mirror of https://github.com/BTCPrivate/z-nomp.git
fixup! Bugfix: Hashrate incorrect
This commit is contained in:
parent
c640b4fbaf
commit
c83ed07049
|
@ -271,14 +271,12 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
|||
};
|
||||
|
||||
this.getReadableHashRateString = function(hashrate){
|
||||
var i = -1;
|
||||
if (hashrate === 0)
|
||||
return '0 Sol';
|
||||
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
||||
do {
|
||||
hashrate = (hashrate * 2) / 1000000;
|
||||
i++;
|
||||
} while (hashrate > 1000);
|
||||
|
||||
hashrate = (hashrate * 2);
|
||||
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||
return hashrate.toFixed(2) + byteUnits[i];
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -69,12 +69,12 @@ function buildChartData(){
|
|||
}
|
||||
|
||||
function getReadableHashRateString(hashrate){
|
||||
var i = -1;
|
||||
if (hashrate === 0)
|
||||
return '0 Sol';
|
||||
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
||||
do {
|
||||
hashrate = (hashrate * 2) / 1000000;
|
||||
i++;
|
||||
} while (hashrate > 1000);
|
||||
hashrate = (hashrate * 2);
|
||||
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||
return Math.round(hashrate) + byteUnits[i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue