Browse Source

Merge pull request #168 from matiu/bug/scan

Varios fixes
activeAddress
Gustavo Maximiliano Cortez 10 years ago
parent
commit
b5b1206f79
  1. 3
      lib/expressapp.js
  2. 18
      lib/server.js

3
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();
});
});

18
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)
@ -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(null, {started: true});
});
};

Loading…
Cancel
Save