From 594a2ae16d2f2ea9beb0e1875d2f3b2416727591 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 9 Aug 2026 02:13:41 -0700 Subject: [PATCH] Hard cap wallet account derivation at 10,000. --- src/lib/wallet/accounts.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/wallet/accounts.ts b/src/lib/wallet/accounts.ts index 7ff6f1a..21a0164 100644 --- a/src/lib/wallet/accounts.ts +++ b/src/lib/wallet/accounts.ts @@ -21,9 +21,12 @@ export async function _accounts (type: WalletType, accounts: Map 10_000) { + if (to - from > 1_000) { console.warn('libnemo performance may degrade when deriving many accounts at once') } + if (to - from > 10_000) { + throw new RangeError('Maximum 10,000 accounts per call') + } const output = new Map() const missing: number[] = [] for (let i = from; i <= to; i++) { -- 2.52.0