From 18a25775233e3dd403e4ac86acad800c95774d70 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 12 Oct 2016 18:42:30 -0300 Subject: [PATCH] check extended private key at import --- src/js/services/profileService.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 659f9dd8f..459b3a6e5 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -134,8 +134,7 @@ angular.module('copayApp.services') if (n.type == "NewBlock" && n.data.network == "testnet") { throttledBwsEvent(n, wallet); - } - else newBwsEvent(n, wallet); + } else newBwsEvent(n, wallet); }); wallet.on('walletCompleted', function() { @@ -600,6 +599,7 @@ angular.module('copayApp.services') var walletClient = bwcService.getClient(null, opts); $log.debug('Importing Wallet:', opts); + try { walletClient.import(str, { compressed: opts.compressed, @@ -611,6 +611,11 @@ angular.module('copayApp.services') str = JSON.parse(str); + if (str.xPrivKey) { + delete str.xPrivKeyEncrypted; + delete str.mnemonicEncrypted; + } + var addressBook = str.addressBook || {}; addAndBindWalletClient(walletClient, {