derive addresses in series

This commit is contained in:
Ivan Socolsky 2015-04-01 18:25:18 -03:00
parent 634daf6450
commit 55655296e3
2 changed files with 3 additions and 2 deletions

View File

@ -1063,7 +1063,7 @@ WalletService.prototype.scan = function(opts, cb) {
var allAddresses = [];
function deriveAddresses(size, derivator, cb) {
async.map(_.range(size), function(i, next) {
async.mapSeries(_.range(size), function(i, next) {
setTimeout(function() {
next(null, derivator());
}, WalletService.scanConfig.DERIVATION_DELAY)
@ -1109,7 +1109,7 @@ WalletService.prototype.scan = function(opts, cb) {
}
});
async.each(derivators, function(derivator, next) {
async.eachSeries(derivators, function(derivator, next) {
scanBranch(derivator, next);
}, function(err) {
if (err) return cb(err);

View File

@ -2483,6 +2483,7 @@ describe('Wallet service', function() {
describe('#scan', function() {
var scanConfigOld = WalletService.scanConfig;
beforeEach(function() {
this.timeout(5000);
WalletService.scanConfig.SCAN_WINDOW = 2;
WalletService.scanConfig.DERIVATION_DELAY = 0;
});