]> git.codecow.com Git - libnemo.git/commitdiff
Hard-cap wallet account derivation batch at 1000, now matches documentation.
authorChris Duncan <chris@codecow.com>
Sun, 9 Aug 2026 20:57:54 +0000 (13:57 -0700)
committerChris Duncan <chris@codecow.com>
Sun, 9 Aug 2026 20:57:54 +0000 (13:57 -0700)
src/lib/wallet/accounts.ts

index 21a0164fa44bf2caf7b0e48ba4f6dc0005d62edf..b437829ba73ea89566a6640900e9285fe644df29 100644 (file)
@@ -21,11 +21,11 @@ export async function _accounts (type: WalletType, accounts: Map<number, Account
        if (from < 0 || 0xffffffff < from || to < 0 || 0xffffffff < to) {
                throw new TypeError('Invalid account range', { cause: `${from}-${to}` })
        }
-       if (to - from > 1_000) {
+       if (to - from > 100) {
                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')
+       if (to - from > 1_000) {
+               throw new RangeError('Maximum 1000 accounts per call')
        }
        const output = new Map<number, Account>()
        const missing: number[] = []