|
|
@ -513,10 +513,15 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
|
|
|
|
|
|
|
async createNewVaultAndRestore (password, seed) { |
|
|
|
async createNewVaultAndRestore (password, seed) { |
|
|
|
const release = await this.createVaultMutex.acquire() |
|
|
|
const release = await this.createVaultMutex.acquire() |
|
|
|
const vault = await this.keyringController.createNewVaultAndRestore(password, seed) |
|
|
|
try { |
|
|
|
this.selectFirstIdentity(vault) |
|
|
|
const vault = await this.keyringController.createNewVaultAndRestore(password, seed) |
|
|
|
release() |
|
|
|
this.selectFirstIdentity(vault) |
|
|
|
return vault |
|
|
|
release() |
|
|
|
|
|
|
|
return vault |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
release() |
|
|
|
|
|
|
|
throw err |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
selectFirstIdentity (vault) { |
|
|
|
selectFirstIdentity (vault) { |
|
|
|