Skip to content

Commit f461389

Browse files
authored
Keyring cache clear (MetaMask#129)
1 parent 8197ded commit f461389

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class KeyringController extends EventEmitter {
7373
* @returns {Promise<Object>} A Promise that resolves to the state.
7474
*/
7575
createNewVaultAndKeychain(password) {
76-
return this.persistAllKeyrings(password)
77-
.then(this.createFirstKeyTree.bind(this))
76+
return this.createFirstKeyTree(password)
7877
.then(this.persistAllKeyrings.bind(this, password))
7978
.then(this.setUnlocked.bind(this))
8079
.then(this.fullUpdate.bind(this));
@@ -498,9 +497,11 @@ class KeyringController extends EventEmitter {
498497
* - Faucets that account on testnet
499498
* - Puts the current seed words into the state tree
500499
*
500+
* @param {string} password - The keyring controller password.
501501
* @returns {Promise<void>} - A promise that resolves if the operation was successful.
502502
*/
503-
createFirstKeyTree() {
503+
createFirstKeyTree(password) {
504+
this.password = password;
504505
this.clearKeyrings();
505506
return this.addNewKeyring('HD Key Tree', { numberOfAccounts: 1 })
506507
.then((keyring) => {

0 commit comments

Comments
 (0)