diff --git a/lib/bcoin/chaindb.js b/lib/bcoin/chaindb.js index e45212e1..6c98bf34 100644 --- a/lib/bcoin/chaindb.js +++ b/lib/bcoin/chaindb.js @@ -1249,6 +1249,9 @@ ChainDB.prototype.getTX = function getTX(hash, callback) { var key = 't/' + hash; var tx; + if (!this.options.indexTX) + return utils.nextTick(callback); + this.db.get(key, function(err, data) { if (err && err.type !== 'NotFoundError') return callback(err); @@ -1275,6 +1278,9 @@ ChainDB.prototype.getTX = function getTX(hash, callback) { */ ChainDB.prototype.hasTX = function hasTX(hash, callback) { + if (!this.options.indexTX) + return utils.asyncify(callback)(null, false); + return this.getTX(hash, function(err, tx) { if (err) return callback(err); @@ -1292,6 +1298,9 @@ ChainDB.prototype.hasTX = function hasTX(hash, callback) { ChainDB.prototype.getFullTX = function getFullTX(hash, callback) { var self = this; + if (!this.options.indexTX) + return utils.nextTick(callback); + return this.getTX(hash, function(err, tx) { if (err) return callback(err); diff --git a/lib/bcoin/mempool.js b/lib/bcoin/mempool.js index ac5f6138..134e83cf 100644 --- a/lib/bcoin/mempool.js +++ b/lib/bcoin/mempool.js @@ -1216,7 +1216,7 @@ Mempool.prototype.fillAllHistory = function fillAllHistory(tx, callback) { if (tx.hasCoins()) return callback(null, tx); - self.chain.db.fillHistory(tx, callback); + self.chain.db.fillCoins(tx, callback); }); };