From 1264892aca9089fc7c2fb7d839bc530fe1393912 Mon Sep 17 00:00:00 2001 From: tj-bitpay Date: Fri, 11 Aug 2017 10:15:46 -0400 Subject: [PATCH] small changes --- lib/blocks.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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);