From: Chris Duncan Date: Sun, 9 Aug 2026 09:13:41 +0000 (-0700) Subject: Hard cap wallet account derivation at 10,000. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=594a2ae16d2f2ea9beb0e1875d2f3b2416727591;p=libnemo.git Hard cap wallet account derivation at 10,000. --- 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++) {