fixes
This commit is contained in:
parent
00d3a0ba67
commit
e6b850124c
|
@ -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'
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue