From 8697d1932918b290f2ea20a2f550414e57501323 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 4 Dec 2023 11:57:40 +0000 Subject: [PATCH] add small comment --- subxt/src/backend/unstable/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subxt/src/backend/unstable/mod.rs b/subxt/src/backend/unstable/mod.rs index 05b78cbd89..fb1437352d 100644 --- a/subxt/src/backend/unstable/mod.rs +++ b/subxt/src/backend/unstable/mod.rs @@ -486,6 +486,8 @@ impl Backend for UnstableBackend { if let Poll::Ready(Some(seen_block)) = seen_blocks_sub.poll_next_unpin(cx) { match seen_block { SeenBlock::New(block_ref) => { + // Optimization: once we have a `finalized_hash`, we only care about finalized + // block refs now and can avoid bothering to save new blocks. if finalized_hash.is_none() { seen_blocks .insert(block_ref.hash(), (SeenBlockMarker::New, block_ref));