From: Chris Duncan Date: Mon, 3 Aug 2026 00:48:05 +0000 (-0700) Subject: Fully await lock request, and be paranoid about failure. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=a144f5bc049c8f42336b47b7901aea2a7c700918;p=libnemo.git Fully await lock request, and be paranoid about failure. --- 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() + } } /**