From a144f5bc049c8f42336b47b7901aea2a7c700918 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 2 Aug 2026 17:48:05 -0700 Subject: [PATCH] Fully await lock request, and be paranoid about failure. --- src/lib/wallet/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/wallet/index.ts b/src/lib/wallet/index.ts index 181174f..9579d4a 100644 --- a/src/lib/wallet/index.ts +++ b/src/lib/wallet/index.ts @@ -316,8 +316,13 @@ export class Wallet { * this is currently the only way to ensure the connection is severed. * `setTimeout` is used to expire any lingering transient user activation. */ - lock (): void { - _lock(this, this.#vault) + async lock (): Promise { + try { + await _lock(this, this.#vault) + } catch { + console.log('Error locking wallet, terminating Vault worker for safety') + this.#vault.terminate() + } } /** -- 2.52.0