Bugfix #51: Incorrect hashrate metrics

This commit is contained in:
joshuayabut 2016-12-27 07:53:15 +00:00
parent a740899460
commit 2a3402baab
2 changed files with 4 additions and 4 deletions

View File

@ -271,9 +271,9 @@ module.exports = function(logger, portalConfig, poolConfigs){
};
this.getReadableHashRateString = function(hashrate){
if (hashrate === 0)
if (hashrate < 1000000)
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);
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);

View File

@ -69,9 +69,9 @@ function buildChartData(){
}
function getReadableHashRateString(hashrate){
if (hashrate === 0)
if (hashrate < 1000000)
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);
var i = Math.floor((Math.log(hashrate/1000) / Math.log(1000)) - 1);
hashrate = (hashrate/1000) / Math.pow(1000, i + 1);