From fa2ffd315e6d70d922a6cdd48c473e0fdc6bd813 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 16 Jul 2025 07:23:53 -0700 Subject: [PATCH] Lock accounts using wallet seed as password when locking wallet. --- src/lib/wallets/wallet.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/wallets/wallet.ts b/src/lib/wallets/wallet.ts index bac12f7..a7530d7 100644 --- a/src/lib/wallets/wallet.ts +++ b/src/lib/wallets/wallet.ts @@ -152,6 +152,11 @@ export abstract class Wallet { throw new Error('Failed to lock wallet') } try { + const promises = [] + for (const account of this.#accounts) { + promises.push(account.lock(this.seed)) + } + await Promise.all(promises) const headers = { method: 'set', name: this.id @@ -168,11 +173,6 @@ export abstract class Wallet { if (!success) { throw null } - const promises = [] - for (const account of this.#accounts) { - promises.push(account.lock(new Uint8Array(password))) - } - await Promise.all(promises) } catch (err) { throw new Error('Failed to lock wallet') } finally { @@ -250,7 +250,7 @@ export abstract class Wallet { } const promises = [] for (const account of this.#accounts) { - promises.push(account.unlock(new Uint8Array(password))) + promises.push(account.unlock(this.seed)) } await Promise.all(promises) } catch (err) { -- 2.47.3