Wrong hashrate calculation

Hashes are not bytes:
> 1 byte = 8 bits
> 1 kilobyte = 1024 bytes

Hashes are the units, and so therefore - as `k`,  `m` only mean *10^3 and *10^6
> 1 hash = 1 hash
> 1 kh     = 1000 hashes
This commit is contained in:
Kaos Dynamics 2014-07-16 21:36:27 +01:00
parent eadc0fadf1
commit c2ca8e4a80
1 changed files with 2 additions and 2 deletions

View File

@ -274,9 +274,9 @@ module.exports = function(logger, portalConfig, poolConfigs){
var i = -1;
var byteUnits = [ ' KH', ' MH', ' GH', ' TH', ' PH' ];
do {
hashrate = hashrate / 1024;
hashrate = hashrate / 1000;
i++;
} while (hashrate > 1024);
} while (hashrate > 1000);
return hashrate.toFixed(2) + byteUnits[i];
};