cpuminer: avoid division by zero.
This commit is contained in:
parent
453bc82a8d
commit
09a2dc0f55
@ -547,7 +547,7 @@ CPUJob.prototype.getHashes = function getHashes(nonce) {
|
|||||||
CPUJob.prototype.getRate = function getRate(nonce) {
|
CPUJob.prototype.getRate = function getRate(nonce) {
|
||||||
const hashes = this.getHashes(nonce);
|
const hashes = this.getHashes(nonce);
|
||||||
const seconds = util.now() - this.start;
|
const seconds = util.now() - this.start;
|
||||||
return Math.floor(hashes / seconds);
|
return Math.floor(hashes / Math.max(1, seconds));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user