chain: fix fill percent.

This commit is contained in:
Christopher Jeffrey 2014-05-26 19:19:14 -05:00
parent 013a85c6a5
commit 2b88192562

View File

@ -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) {