From c9b84252af5d6eda719342f85cc3c697159688fa Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 24 Oct 2016 18:55:34 -0700 Subject: [PATCH] scanning: only add matching txids for outputs. --- lib/chain/chaindb.js | 1 - lib/http/server.js | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/chain/chaindb.js b/lib/chain/chaindb.js index 60d21d43..c4ce22d4 100644 --- a/lib/chain/chaindb.js +++ b/lib/chain/chaindb.js @@ -1153,7 +1153,6 @@ ChainDB.prototype.scan = co(function* scan(start, filter, iter) { prevout = input.prevout; if (filter.test(prevout.hash, 'hex')) { txs.push(tx); - filter.add(tx.hash()); found = true; break; } diff --git a/lib/http/server.js b/lib/http/server.js index 45dba5fc..ca87df01 100644 --- a/lib/http/server.js +++ b/lib/http/server.js @@ -1570,10 +1570,8 @@ ClientSocket.prototype.testFilter = function testFilter(tx) { for (i = 0; i < tx.inputs.length; i++) { input = tx.inputs[i]; prevout = input.prevout; - if (this.filter.test(prevout.hash, 'hex')) { - this.filter.add(tx.hash()); + if (this.filter.test(prevout.hash, 'hex')) return true; - } } }