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,