diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2016-12-23 06:43:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-23 06:43:43 +0800 |
commit | 898e96fd6ae905932a60d60c42e2c3bddab65556 (patch) | |
tree | 23fba23503db1da05c1b397487aa71e3d9cb7d58 /app/scripts/lib | |
parent | 98527c1c254fe2d438191c73053dcf3223062ef3 (diff) | |
parent | d3b2698f341e1d0dda86612cdf331e51067719c5 (diff) | |
download | tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar.gz tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar.bz2 tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar.lz tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar.xz tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.tar.zst tangerine-wallet-browser-898e96fd6ae905932a60d60c42e2c3bddab65556.zip |
Merge pull request #948 from MetaMask/RecoverLostAccounts
Auto-Recover accounts lost to BIP44 derivation fix
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/idStore-migrator.js | 7 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index d36ccf0db..ede877b76 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -121,7 +121,7 @@ ConfigManager.prototype.setVault = function (encryptedString) { ConfigManager.prototype.getVault = function () { var data = this.getData() - return ('vault' in data) && data.vault + return data.vault } ConfigManager.prototype.getKeychains = function () { diff --git a/app/scripts/lib/idStore-migrator.js b/app/scripts/lib/idStore-migrator.js index 2e9418376..655aed0af 100644 --- a/app/scripts/lib/idStore-migrator.js +++ b/app/scripts/lib/idStore-migrator.js @@ -63,7 +63,12 @@ module.exports = class IdentityStoreMigrator { return { serialized, - lostAccounts, + lostAccounts: lostAccounts.map((address) => { + return { + address, + privateKey: this.idStore.exportAccount(address), + } + }), } }) } diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index cf4353e48..66e5d966c 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -202,7 +202,8 @@ IdentityStore.prototype.submitPassword = function (password, cb) { IdentityStore.prototype.exportAccount = function (address, cb) { var privateKey = this._idmgmt.exportPrivateKey(address) - cb(null, privateKey) + if (cb) cb(null, privateKey) + return privateKey } // |