From e6b850124c3eb020066ea001e68cc1ae33f15035 Mon Sep 17 00:00:00 2001 From: Patrick Nagurny Date: Tue, 15 Sep 2015 17:25:41 -0400 Subject: [PATCH] fixes --- lib/services/db.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/services/db.js b/lib/services/db.js index 206a5d24..7e90b870 100644 --- a/lib/services/db.js +++ b/lib/services/db.js @@ -199,13 +199,19 @@ DB.prototype.getBlock = function(hash, callback) { }); }; +/** + * get block hashes between two timestamps + * @param {Number} start - first timestamp, in seconds, inclusive + * @param {Number} end - second timestamp, in seconds, inclusive + * @param {Function} callback + */ DB.prototype.getBlockHashesByTimestamp = function(start, end, callback) { var self = this; var hashes = []; var stream = this.store.createReadStream({ - start: this._encodeBlockIndexKey(start), - end: this._encodeBlockIndexKey(end), + gte: this._encodeBlockIndexKey(start), + lte: this._encodeBlockIndexKey(end), valueEncoding: 'binary', keyEncoding: 'binary' });