blocks: rename moreTs -> moreTimestamp for clarity

This commit is contained in:
Braydon Fuller 2016-05-10 16:24:37 -04:00
parent 0ba78e7180
commit 310dd99086

View File

@ -147,12 +147,12 @@ BlockController.prototype.blockIndex = function(req, res, next, height) {
}); });
}; };
BlockController.prototype._getBlockSummary = function(hash, moreTs, next) { BlockController.prototype._getBlockSummary = function(hash, moreTimestamp, next) {
var self = this; var self = this;
function finish(result) { function finish(result) {
if (moreTs > result.time) { if (moreTimestamp > result.time) {
moreTs = result.time; moreTimestamp = result.time;
} }
return next(null, result); return next(null, result);
} }
@ -236,7 +236,7 @@ BlockController.prototype.list = function(req, res) {
var next = lte ? this.formatTimestamp(new Date(lte * 1000)) : null; var next = lte ? this.formatTimestamp(new Date(lte * 1000)) : null;
var limit = parseInt(req.query.limit || BLOCK_LIMIT); var limit = parseInt(req.query.limit || BLOCK_LIMIT);
var more = false; var more = false;
var moreTs = lte; var moreTimestamp = lte;
self.node.services.bitcoind.getBlockHashesByTimestamp(lte, gte, function(err, hashes) { self.node.services.bitcoind.getBlockHashesByTimestamp(lte, gte, function(err, hashes) {
if(err) { if(err) {
@ -253,7 +253,7 @@ BlockController.prototype.list = function(req, res) {
async.mapSeries( async.mapSeries(
hashes, hashes,
function(hash, next) { function(hash, next) {
self._getBlockSummary(hash, moreTs, next); self._getBlockSummary(hash, moreTimestamp, next);
}, },
function(err, blocks) { function(err, blocks) {
if(err) { if(err) {
@ -278,7 +278,7 @@ BlockController.prototype.list = function(req, res) {
}; };
if(more) { if(more) {
data.pagination.moreTs = moreTs; data.pagination.moreTs = moreTimestamp;
} }
res.jsonp(data); res.jsonp(data);