From de9f37b290a3f2e8221eebc5915c6534f26f4eb0 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 8 Aug 2017 14:31:42 -0700 Subject: [PATCH] merkleblock: minor. style. --- lib/primitives/merkleblock.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/primitives/merkleblock.js b/lib/primitives/merkleblock.js index 0d7b094e..5ff6b7d9 100644 --- a/lib/primitives/merkleblock.js +++ b/lib/primitives/merkleblock.js @@ -522,7 +522,6 @@ MerkleBlock.fromBlock = function fromBlock(block, filter) { MerkleBlock.fromHashes = function fromHashes(block, hashes) { const filter = new Set(); - const matches = []; for (let hash of hashes) { if (Buffer.isBuffer(hash)) @@ -530,6 +529,8 @@ MerkleBlock.fromHashes = function fromHashes(block, hashes) { filter.add(hash); } + const matches = []; + for (const tx of block.txs) { const hash = tx.hash('hex'); matches.push(filter.has(hash) ? 1 : 0);