chain: misc fixes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-18 03:01:25 -05:00 committed by Fedor Indutny
parent 14a36fbe76
commit b041d3ae99

View File

@ -279,7 +279,7 @@ Chain.prototype.has = function has(hash, noProbe, cb) {
} }
if (this.loading) { if (this.loading) {
this.once('load', function() { this.once('load', function() {
this.has(hash, cb); this.has(hash, noProbe, cb);
}); });
return; return;
} }
@ -297,7 +297,7 @@ Chain.prototype.has = function has(hash, noProbe, cb) {
if (!noProbe && this.index.bloom.test(hash, 'hex')) { if (!noProbe && this.index.bloom.test(hash, 'hex')) {
// XXX find hash // XXX find hash
return true; return cb(true);
} }
return cb(!!this.orphan.map[hash]); return cb(!!this.orphan.map[hash]);