From: Chris Duncan Date: Mon, 3 Aug 2026 17:19:09 +0000 (-0700) Subject: Validate frontiers RPC response. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=04e2b80631673b80f3772cee614449169cbf13f1;p=libnemo.git Validate frontiers RPC response. --- diff --git a/src/lib/wallet/unopened.ts b/src/lib/wallet/unopened.ts index 14b40f0..fc5ef37 100644 --- a/src/lib/wallet/unopened.ts +++ b/src/lib/wallet/unopened.ts @@ -25,8 +25,9 @@ export async function _unopened (wallet: Wallet, rpc: unknown, batchSize: unknow const data = { "accounts": addresses } - const { errors } = await rpc.post('accounts_frontiers', data) - if (errors != null) { + const res = await rpc.post('accounts_frontiers', data) + if (res != null && typeof res === 'object' && 'errors' in res && res.errors != null && typeof res.errors === 'object') { + const errors = res.errors as Record for (const a of addresses) { const value = errors[a] if (value === 'Account not found') {