From 1edc3087bc561acbac91639e04d184c2709cdbbe Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 10 Sep 2025 13:54:58 -0700 Subject: [PATCH] Require 10-second minimum vault timeout. --- src/lib/vault/vault-worker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/vault/vault-worker.ts b/src/lib/vault/vault-worker.ts index f2a2d02..c18fcef 100644 --- a/src/lib/vault/vault-worker.ts +++ b/src/lib/vault/vault-worker.ts @@ -123,11 +123,11 @@ export class VaultWorker { throw new Error('Wallet is locked') } if (typeof timeout === 'number') { - if (timeout < 0) { - throw new RangeError('Timeout must be non-negative') + if (timeout < 10) { + throw new RangeError('Timeout must be at least 10 seconds') } if (timeout > 600) { - throw new RangeError('Maximum timeout is 10 minutes') + throw new RangeError('Timeout must be at most 10 minutes') } this.#timeout = timeout * 1000 this.#timer = new VaultTimer(() => this.lock(), this.#timeout) -- 2.47.3