From b2065cc84d6ae908aefb8ea90bf2b81cf83f9614 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 8 Dec 2016 01:47:39 -0800 Subject: [PATCH] mempool: minor. --- lib/mempool/mempool.js | 14 +++++--------- test/mempool-test.js | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index de7f2529..2d9cfd08 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -1470,15 +1470,16 @@ Mempool.prototype.removeOrphan = function removeOrphan(hash) { continue; j = hashes.indexOf(hash); - if (j !== -1) - hashes.splice(j, 1); + + if (j === -1) + continue; + + hashes.splice(j, 1); if (hashes.length === 0) { delete this.waiting[prev]; continue; } - - this.waiting[prev] = hashes; } delete this.orphans[hash]; @@ -1622,11 +1623,6 @@ Mempool.prototype.fillAllCoins = co(function* fillAllCoins(tx) { hash = input.prevout.hash; index = input.prevout.index; - if (this.options.test) { - if (input.coin) - continue; - } - coin = this.getCoin(hash, index); if (coin) { diff --git a/test/mempool-test.js b/test/mempool-test.js index 56f8d4c8..2c78210c 100644 --- a/test/mempool-test.js +++ b/test/mempool-test.js @@ -24,8 +24,7 @@ describe('Mempool', function() { mempool = new bcoin.mempool({ chain: chain, name: 'mempool-test', - db: 'memory', - test: true + db: 'memory' }); walletdb = new bcoin.walletdb({