mirror of https://github.com/BTCPrivate/z-nomp.git
Bugfix #51: Incorrect hashrate metrics
This commit is contained in:
parent
a740899460
commit
2a3402baab
|
@ -271,9 +271,9 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getReadableHashRateString = function(hashrate){
|
this.getReadableHashRateString = function(hashrate){
|
||||||
if (hashrate === 0)
|
if (hashrate < 1000000)
|
||||||
return '0 Sol';
|
return '0 Sol';
|
||||||
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
var byteUnits = [ ' Sol/s', ' KSol/s', ' MSol/s', ' GSol/s', ' TSol/s', ' PSol/s' ];
|
||||||
hashrate = (hashrate * 2);
|
hashrate = (hashrate * 2);
|
||||||
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||||
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||||
|
|
|
@ -69,9 +69,9 @@ function buildChartData(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReadableHashRateString(hashrate){
|
function getReadableHashRateString(hashrate){
|
||||||
if (hashrate === 0)
|
if (hashrate < 1000000)
|
||||||
return '0 Sol';
|
return '0 Sol';
|
||||||
var byteUnits = [ ' Sol', ' KSol', ' MSol', ' GSol', ' TSol', ' PSol' ];
|
var byteUnits = [ ' Sol/s', ' KSol/s', ' MSol/s', ' GSol/s', ' TSol/s', ' PSol/s' ];
|
||||||
hashrate = (hashrate * 2);
|
hashrate = (hashrate * 2);
|
||||||
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
|
||||||
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);
|
||||||
|
|
Loading…
Reference in New Issue