diff --git a/lib/net/pool.js b/lib/net/pool.js index 05f4f225..de2a06ec 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -1563,8 +1563,8 @@ Pool.prototype._handleHeaders = co(function* handleHeaders(peer, packet) { for (i = 0; i < headers.length; i++) { header = headers[i]; - hash = header.hash('hex'); last = this.headerChain.tail; + hash = header.hash('hex'); height = last.height + 1; if (header.prevBlock !== last.hash) { @@ -1580,7 +1580,7 @@ Pool.prototype._handleHeaders = co(function* handleHeaders(peer, packet) { return; } - node = new BlockNode(hash, last.height + 1); + node = new BlockNode(hash, height); if (!this.headerNext) this.headerNext = node;