From: Chris Duncan Date: Wed, 5 Aug 2026 00:48:27 +0000 (-0700) Subject: Cap unopened account search at max index. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=e1c25204bb92312ec74a11c725191a2962d11da0;p=libnemo.git Cap unopened account search at max index. --- diff --git a/src/lib/wallet/unopened.ts b/src/lib/wallet/unopened.ts index ebdc59a..da92e18 100644 --- a/src/lib/wallet/unopened.ts +++ b/src/lib/wallet/unopened.ts @@ -39,5 +39,8 @@ export async function _unopened (wallet: Wallet, rpc: unknown, batchSize: unknow } } } - return await _unopened(wallet, rpc, batchSize, to) + if (to >= 0xffffffff) { + throw new RangeError('Max index reached') + } + return await _unopened(wallet, rpc, batchSize, to) : }