---
issue: 110
title: "Scanner: TON worker O(N) HTTP fan-out per scan cycle — one TonCenter call per intent"
severity: medium
domain: Scanner
labels: [performance, scanner, scalability]
status: open
created: 2026-05-30
source: Full Codebase Audit 2026-05-30
---

# Scanner: TON worker O(N) HTTP fan-out per scan cycle — one TonCenter call per intent

**Severity:** medium
**Domain:** Scanner
**Labels:** performance, scanner, scalability

## Description

`scanner/ton_chain.go:131` issues one TonCenter API call per pending intent per scan cycle. With N pending intents, this creates N outbound HTTP calls per cycle. Under load or with many intents, this exhausts outbound connection capacity and hits TonCenter rate limits.

## Options

1. Batch intents by destination/jetton and query once per group.
2. Bounded-concurrency worker pool for per-intent calls.
3. Subscribe to TonCenter streaming/index instead of polling.

## Recommendation

Batch queries by jetton/destination where the API allows; otherwise bound concurrency. A TODO is already noted in the code.

## Affected Files

- `scanner/ton_chain.go:131`

## References

- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-66
