Skip to content

Commit 59667b8

Browse files
committed
fix #withRollback: restore this.#encryptionKey
1 parent 5f4b620 commit 59667b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/keyring-controller/src/KeyringController.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2901,11 +2901,13 @@ export class KeyringController extends BaseController<
29012901
return this.#withControllerLock(async ({ releaseLock }) => {
29022902
const currentSerializedKeyrings = await this.#getSerializedKeyrings();
29032903
const currentPassword = this.#password;
2904+
const currentEncryptionKey = this.#encryptionKey;
29042905
try {
29052906
return await callback({ releaseLock });
29062907
} catch (e) {
2907-
// Keyrings and password are restored to their previous state
2908+
// Previous state is restored.
29082909
this.#password = currentPassword;
2910+
this.#encryptionKey = currentEncryptionKey;
29092911
await this.#restoreSerializedKeyrings(currentSerializedKeyrings);
29102912

29112913
throw e;

0 commit comments

Comments
 (0)