Skip to content

Commit

Permalink
fix(BlockStream): don't emit 'from' block
Browse files Browse the repository at this point in the history
  • Loading branch information
mappum committed Jan 14, 2016
1 parent eba2aea commit 831168a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/blockStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ BlockStream.prototype._next = function () {
if (!this.requestCursor) return
this.chain.getBlock(this.requestCursor, function (err, block) {
if (err) return self._error(err)
if (!self._from) self._from = block
var hash = u.toHash(block.header.hash)
if (self.requestHeight == null) self.requestHeight = block.height
self.requestQueue.push(hash)
self._getData(block)
if (block.height > self._from.height) {
if (self.requestHeight == null) {
self.requestHeight = block.height
}
self.requestQueue.push(hash)
self._getData(block)
}
if (!block.next) {
return self.requestQueue.push(null)
}
Expand Down

0 comments on commit 831168a

Please sign in to comment.