diff --git a/lib/services/address/index.js b/lib/services/address/index.js index 81e18930..a93b9418 100644 --- a/lib/services/address/index.js +++ b/lib/services/address/index.js @@ -189,6 +189,10 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream options.queryMempool = true; } + if (_.isUndefined(options.mempoolOnly)) { + options.mempoolOnly = false; + } + var old_support = false; //Quick support for `from` and `to` options (DEPRECATED! Not recommeded to use) if( !_.isUndefined(options.from) || !_.isUndefined(options.to)) { @@ -859,6 +863,10 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre options.queryMempool = true; } + if (_.isUndefined(options.mempoolOnly)) { + options.mempoolOnly = false; + } + //declare the queue to process tx data var tmpTxList = {}; //store processed txid temporarily to ignore duplication @@ -950,6 +958,10 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre // stream the rest of the confirmed txids out of the address index function(next) { + if (options.mempoolOnly) { //Option to query from mempool only (ie, unconfirmed txs only) + return next(); + } + var txIdTransformStream = new Transform({ objectMode: true }); txIdTransformStream._flush = function(cb) {