aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 58366c26f..2888e58a9 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -114,6 +114,7 @@ module.exports = class KeyringController extends EventEmitter {
conversionDate: this.configManager.getConversionDate(),
keyringTypes: this.keyringTypes.map(krt => krt.type),
identities: this.identities,
+ lostAccounts: this.configManager.getLostAccounts(),
}
}
@@ -622,11 +623,17 @@ module.exports = class KeyringController extends EventEmitter {
// may be completed without interruption.
migrateOldVaultIfAny (password) {
const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault()
+ if (!shouldMigrate) {
+ return Promise.resolve()
+ }
+
return this.idStoreMigrator.migratedVaultForPassword(password)
- .then((serialized) => {
+ .then((result) => {
this.password = password
- if (serialized && shouldMigrate) {
+ if (result && shouldMigrate) {
+ const { serialized, lostAccounts } = result
+ this.configManager.setLostAccounts(lostAccounts)
return this.restoreKeyring(serialized)
.then(keyring => keyring.getAccounts())
.then((accounts) => {