Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit b5b1206

Browse files
committed
Merge pull request #168 from matiu/bug/scan
Varios fixes
2 parents da361d8 + 7cbdf3c commit b5b1206

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

lib/expressapp.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ ExpressApp.start = function(opts) {
288288

289289
router.post('/v1/addresses/scan/', function(req, res) {
290290
getServerWithAuth(req, res, function(server) {
291-
server.startScan(req.body, function(err) {
291+
server.startScan(req.body, function(err, started) {
292292
if (err) return returnError(err, res, req);
293+
res.json(started);
293294
res.end();
294295
});
295296
});

lib/server.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ WalletService.prototype.replaceTemporaryRequestKey = function(opts, cb) {
205205
});
206206
$.checkState(oldCopayerData);
207207

208-
if (oldCopayerData.xPubKey !== opts.xPubKey || oldCopayerData.name !== opts.name || !oldCopayerData.isTemporaryRequestKey)
208+
if (oldCopayerData.xPubKey !== opts.xPubKey || !oldCopayerData.isTemporaryRequestKey)
209209
return cb(new ClientError('CDATAMISMATCH', 'Copayer data mismatch'));
210210

211211
if (wallet.copayers.length != wallet.n)
@@ -1223,17 +1223,15 @@ WalletService.prototype.startScan = function(opts, cb) {
12231223
self._notify('ScanFinished', data, true);
12241224
};
12251225

1226-
Utils.runLocked(self.walletId, cb, function(cb) {
1227-
self.getWallet({}, function(err, wallet) {
1228-
if (err) return cb(err);
1229-
if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete'));
1226+
self.getWallet({}, function(err, wallet) {
1227+
if (err) return cb(err);
1228+
if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete'));
12301229

1231-
setTimeout(function() {
1232-
self.scan(opts, scanFinished);
1233-
}, 100);
1230+
setTimeout(function() {
1231+
self.scan(opts, scanFinished);
1232+
}, 100);
12341233

1235-
return cb();
1236-
});
1234+
return cb(null, {started: true});
12371235
});
12381236
};
12391237

0 commit comments

Comments
 (0)