From 55655296e3163b2d069b03e28f5d65b33dc87f08 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Wed, 1 Apr 2015 18:25:18 -0300 Subject: [PATCH] derive addresses in series --- lib/server.js | 4 ++-- test/integration/server.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index fcdee58..78eb298 100644 --- a/lib/server.js +++ b/lib/server.js @@ -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); diff --git a/test/integration/server.js b/test/integration/server.js index 79c78cc..ed74cd9 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -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; });