From 1aa2eceeca352104a22dbaa4687613af4980d83c Mon Sep 17 00:00:00 2001 From: Arowolokehinde Date: Tue, 18 Aug 2026 14:50:30 +0100 Subject: [PATCH] docs(esplora): replace misleading tx-cache TODO with explanation --- crates/esplora/src/async_ext.rs | 6 +++++- crates/esplora/src/blocking_ext.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 2b38289526..5845c74ec4 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -492,7 +492,11 @@ where let mut update = TxUpdate::::default(); // make sure txs exists in graph and tx statuses are updated - // TODO: We should maintain a tx cache (like we do with Electrum). + // A tx cache doesn't help here: Esplora's spk scan already returns full tx bodies (unlike + // Electrum, which needs a follow-up fetch per txid), and `inserted_txs` already dedupes + // against what that earlier spk phase fetched this sync. Swapping `get_tx_info` for + // `get_tx_status` to skip refetches is unsafe: unknown txids return HTTP 200 + // {"confirmed":false}, so evicted txs would never be evicted. update.extend( fetch_txs_with_txids( client, diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 225b574ea4..1fc6eef124 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -451,7 +451,11 @@ fn fetch_txs_with_outpoints>( let mut update = TxUpdate::::default(); // make sure txs exists in graph and tx statuses are updated - // TODO: We should maintain a tx cache (like we do with Electrum). + // A tx cache doesn't help here: Esplora's spk scan already returns full tx bodies (unlike + // Electrum, which needs a follow-up fetch per txid), and `inserted_txs` already dedupes + // against what that earlier spk phase fetched this sync. Swapping `get_tx_info` for + // `get_tx_status` to skip refetches is unsafe: unknown txids return HTTP 200 + // {"confirmed":false}, so evicted txs would never be evicted. update.extend(fetch_txs_with_txids( client, start_time,