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) {
|
DB.prototype.getBlockHashesByTimestamp = function(start, end, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var hashes = [];
|
var hashes = [];
|
||||||
|
|
||||||
var stream = this.store.createReadStream({
|
var stream = this.store.createReadStream({
|
||||||
start: this._encodeBlockIndexKey(start),
|
gte: this._encodeBlockIndexKey(start),
|
||||||
end: this._encodeBlockIndexKey(end),
|
lte: this._encodeBlockIndexKey(end),
|
||||||
valueEncoding: 'binary',
|
valueEncoding: 'binary',
|
||||||
keyEncoding: 'binary'
|
keyEncoding: 'binary'
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user