diff --git a/lib/blocks.js b/lib/blocks.js index 4d286a523..cb4e83cff 100644 --- a/lib/blocks.js +++ b/lib/blocks.js @@ -254,10 +254,9 @@ BlockController.prototype.list = function(req, res) { //pagination var lte = parseInt(req.query.startTimestamp) || gte + 86400; var prev = this.formatTimestamp(new Date((gte - 86400) * 1000)); - var next = lte ? this.formatTimestamp(new Date(lte * 1000)) : null; + var next = this.formatTimestamp(new Date(lte * 1000)); var limit = parseInt(req.query.limit || BLOCK_LIMIT); var more = false; - var moreTimestamp = lte; self.node.services.bitcoind.getBlockHashesByTimestamp(lte, gte, function(err, hashes) { if(err) { @@ -274,7 +273,7 @@ BlockController.prototype.list = function(req, res) { async.mapSeries( hashes, function(hash, next) { - self._getBlockSummary(hash, moreTimestamp, next); + self._getBlockSummary(hash, lte, next); }, function(err, blocks) { if(err) { @@ -299,7 +298,7 @@ BlockController.prototype.list = function(req, res) { }; if(more) { - data.pagination.moreTs = moreTimestamp; + data.pagination.moreTs = lte; } res.jsonp(data);