check mempool before requesting tx.

This commit is contained in:
Christopher Jeffrey 2016-05-06 14:03:50 -07:00
parent 5d1e3e1034
commit 3326078694
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1612,8 +1612,14 @@ Pool.prototype.getData = function getData(peer, type, hash, options, callback) {
return callback();
}
if (!options.force && type !== self.tx.type)
return self.chain.has(hash, done);
if (!options.force) {
if (type === this.tx.type) {
if (!this.mempool)
return utils.asyncify(done)(null, false);
return this.mempool.hasTX(hash, done);
}
return this.chain.has(hash, done);
}
return utils.nextTick(function() {
return done(null, false);