add address index to mempool + noBalance options

This commit is contained in:
Matias Alejo Garcia 2016-02-08 13:21:53 -05:00
parent e7e33313cf
commit c1d3f351f2
3 changed files with 7 additions and 2 deletions

View File

@ -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);
},

View File

@ -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);

View File

@ -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) {