Merge pull request #2 from maraoz/feature/bitcore01

add failing test for mati to fix
This commit is contained in:
Matias Alejo Garcia 2014-07-25 10:53:46 -03:00
commit ab0aee7e89
2 changed files with 50 additions and 4 deletions

View File

@ -17,9 +17,9 @@ angular.module('copayApp.controllers').controller('ImportController',
updateStatus('Importing wallet - Setting things up...'); updateStatus('Importing wallet - Setting things up...');
var w, errMsg; var w, errMsg;
// try to import encrypted wallet with passphrase
try { try {
w = walletFactory.import(encryptedObj, passphrase); w = walletFactory.import(encryptedObj, passphrase);
} catch (e) { } catch (e) {
errMsg = e.message; errMsg = e.message;
} }
@ -31,12 +31,14 @@ angular.module('copayApp.controllers').controller('ImportController',
return; return;
} }
// if wallet was never used, we're done
if (!w.isReady()) { if (!w.isReady()) {
$rootScope.wallet = w; $rootScope.wallet = w;
controllerUtils.startNetwork($rootScope.wallet, $scope); controllerUtils.startNetwork($rootScope.wallet, $scope);
return; return;
} }
// if it was used, we need to scan for indices
w.updateIndexes(function(err) { w.updateIndexes(function(err) {
updateStatus('Importing wallet - We are almost there...'); updateStatus('Importing wallet - We are almost there...');
if (err) { if (err) {

File diff suppressed because one or more lines are too long