From ac24f668018017e8133fbbacd9c9dc83f42ad3de Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 3 Apr 2015 16:09:48 -0300 Subject: [PATCH 1/3] do not check name on replaceKey --- lib/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index 86e6fa1..67d75b4 100644 --- a/lib/server.js +++ b/lib/server.js @@ -205,7 +205,7 @@ WalletService.prototype.replaceTemporaryRequestKey = function(opts, cb) { }); $.checkState(oldCopayerData); - if (oldCopayerData.xPubKey !== opts.xPubKey || oldCopayerData.name !== opts.name || !oldCopayerData.isTemporaryRequestKey) + if (oldCopayerData.xPubKey !== opts.xPubKey || !oldCopayerData.isTemporaryRequestKey) return cb(new ClientError('CDATAMISMATCH', 'Copayer data mismatch')); if (wallet.copayers.length != wallet.n) From 936014495012a21852fc820dd902f5e21a8ee41b Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 3 Apr 2015 18:49:08 -0300 Subject: [PATCH 2/3] rm run locked --- lib/server.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/server.js b/lib/server.js index 67d75b4..847de42 100644 --- a/lib/server.js +++ b/lib/server.js @@ -1223,17 +1223,15 @@ WalletService.prototype.startScan = function(opts, cb) { self._notify('ScanFinished', data, true); }; - Utils.runLocked(self.walletId, cb, function(cb) { - self.getWallet({}, function(err, wallet) { - if (err) return cb(err); - if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete')); + self.getWallet({}, function(err, wallet) { + if (err) return cb(err); + if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete')); - setTimeout(function() { - self.scan(opts, scanFinished); - }, 100); + setTimeout(function() { + self.scan(opts, scanFinished); + }, 100); - return cb(); - }); + return cb(); }); }; From 7cbdf3c677a3d9a7489a661acf9aa6b13c40f221 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 4 Apr 2015 13:03:19 -0300 Subject: [PATCH 3/3] return on scan POST --- lib/expressapp.js | 3 ++- lib/server.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/expressapp.js b/lib/expressapp.js index 74f0bd6..148e187 100644 --- a/lib/expressapp.js +++ b/lib/expressapp.js @@ -288,8 +288,9 @@ ExpressApp.start = function(opts) { router.post('/v1/addresses/scan/', function(req, res) { getServerWithAuth(req, res, function(server) { - server.startScan(req.body, function(err) { + server.startScan(req.body, function(err, started) { if (err) return returnError(err, res, req); + res.json(started); res.end(); }); }); diff --git a/lib/server.js b/lib/server.js index 847de42..23cad98 100644 --- a/lib/server.js +++ b/lib/server.js @@ -1231,7 +1231,7 @@ WalletService.prototype.startScan = function(opts, cb) { self.scan(opts, scanFinished); }, 100); - return cb(); + return cb(null, {started: true}); }); };