From d035eb10eb8ff79ffafd733a90682cc28a4d7225 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 20 Jan 2017 17:01:51 -0800 Subject: [PATCH] pool: getblocks fix again. --- lib/net/pool.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/net/pool.js b/lib/net/pool.js index b7b96461..0396d438 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -1435,13 +1435,15 @@ Pool.prototype.handleGetBlocks = co(function* handleGetBlocks(peer, packet) { while (hash) { blocks.push(new InvItem(invTypes.BLOCK, hash)); - if (blocks.length === 500) { + if (hash === packet.stop) { peer.hashContinue = hash; break; } - if (hash === packet.stop) + if (blocks.length === 500) { + peer.hashContinue = hash; break; + } hash = yield this.chain.db.getNextHash(hash); }