From 0e5d7c41f25a996781867a1ee97971a456474e3e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 1 Jan 2016 19:54:22 -0800 Subject: [PATCH] refactor chain.has. --- lib/bcoin/chain.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index dacdcbe9..dca86ee8 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -378,14 +378,12 @@ Chain.prototype.has = function has(hash, noProbe, cb) { } } - if (!noProbe && this.index.bloom.test(hash, 'hex')) { - // XXX find hash - return cb(true); - } - if (this.hasOrphan(hash)) return cb(true); + if (!noProbe && this.hasBlock(hash)) + return cb(true); + return cb(false); };