diff --git a/src/servers/sidecar/wallet/index.ts b/src/servers/sidecar/wallet/index.ts index 471afa36..5fd3f3d0 100644 --- a/src/servers/sidecar/wallet/index.ts +++ b/src/servers/sidecar/wallet/index.ts @@ -94,6 +94,12 @@ const server = Bun.serve({ hostname: '127.0.0.1', // Wallet payloads are small — PSBTs and invoices, never file uploads. A tight cap is free hardening. maxRequestBodySize: 1 * 1024 * 1024, + // Bun's default is 10s, which is SHORTER than the Esplora client's own 20s per-request timeout. That + // inversion is why a slow or unreachable upstream showed up as a wallet with no data at all rather than + // as an error: Bun killed the response before the scan could either finish or report why it hadn't. + // A gap-limit scan is many sequential rounds, so the ceiling has to sit above the whole walk, not one + // request. Bun caps this at 255s; every other sidecar already uses that. + idleTimeout: 255, async fetch(req) { const url = new URL(req.url);