From c1d3f351f23c7834599301aea62e740c1573ec41 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 8 Feb 2016 13:21:53 -0500 Subject: [PATCH] add address index to mempool + noBalance options --- lib/services/address/history.js | 2 +- test/services/address/history.unit.js | 3 ++- test/services/address/index.unit.js | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/services/address/history.js b/lib/services/address/history.js index b7750068..946eac26 100644 --- a/lib/services/address/history.js +++ b/lib/services/address/history.js @@ -96,7 +96,7 @@ AddressHistory.prototype.get = function(callback) { opts.fullTxList = true; async.mapLimit( self.addresses, - self.maxaddressesLimit, + self.maxAddressesLimit, function(address, next) { self.node.services.address.getAddressSummary(address, opts, next); }, diff --git a/test/services/address/history.unit.js b/test/services/address/history.unit.js index 6ddb7369..917ac735 100644 --- a/test/services/address/history.unit.js +++ b/test/services/address/history.unit.js @@ -154,7 +154,8 @@ describe('Address Service History', function() { history.node.services.address.getAddressSummary.callCount.should.equal(2); history.node.services.address.getAddressSummary.args[0][0].should.equal(address); history.node.services.address.getAddressSummary.args[0][1].should.deep.equal({ - fullTxList: true + fullTxList: true, + noBalance: true, }); history._paginateWithDetails.callCount.should.equal(1); history._paginateWithDetails.args[0][0].should.equal(txids); diff --git a/test/services/address/index.unit.js b/test/services/address/index.unit.js index a35614df..929c0c84 100644 --- a/test/services/address/index.unit.js +++ b/test/services/address/index.unit.js @@ -2519,6 +2519,10 @@ describe('Address Service', function() { 0 ); as.mempoolSpentIndex[spentIndexSyncKey] = true; + + var hashBufferHex = address.hashBuffer.toString('hex'); + as.mempoolAddressIndex[hashBufferHex] = true; + as._getInputsMempool = sinon.stub().callsArgWith(3, null, mempoolInputs); as._getOutputsMempool = sinon.stub().callsArgWith(3, null, mempoolOutputs); as._getAddressMempoolSummary(address, options, resultBase, function(err, result) {