From: Chris Duncan Date: Wed, 16 Jul 2025 14:23:53 +0000 (-0700) Subject: Lock accounts using wallet seed as password when locking wallet. X-Git-Tag: v0.10.5~56^2~28 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=fa2ffd315e6d70d922a6cdd48c473e0fdc6bd813;p=libnemo.git Lock accounts using wallet seed as password when locking wallet. --- 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) {