chain: fix fill percent.
This commit is contained in:
parent
013a85c6a5
commit
2b88192562
@ -342,7 +342,7 @@ Chain.prototype.isFull = function isFull() {
|
||||
Chain.prototype.fillPercent = function fillPercent() {
|
||||
var total = (+new Date() / 1000 - 40 * 60) - this.index.lastTs;
|
||||
var current = this.index.ts[this.index.ts.length - 1] - this.index.lastTs;
|
||||
return Math.min(0, Math.max(current / total, 1));
|
||||
return Math.max(0, Math.min(current / total, 1));
|
||||
};
|
||||
|
||||
Chain.prototype.hashesInRange = function hashesInRange(start, end, cb) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user