From 608056a34aa925a046465504a788a8f92613b9d4 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 13 Mar 2025 13:06:36 +0100 Subject: [PATCH] core/filtermaps: remove nil checks for targetView It can never be nil. --- core/filtermaps/filtermaps.go | 4 +++- core/filtermaps/indexer.go | 9 +++------ core/filtermaps/matcher_backend.go | 6 ++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/filtermaps/filtermaps.go b/core/filtermaps/filtermaps.go index af4a3d6e9f..f1be3bfaac 100644 --- a/core/filtermaps/filtermaps.go +++ b/core/filtermaps/filtermaps.go @@ -212,6 +212,8 @@ func NewFilterMaps(db ethdb.KeyValueStore, initView *ChainView, params Params, c baseRowsCache: lru.NewCache[uint64, [][]uint32](cachedBaseRows), renderSnapshots: lru.NewCache[uint64, *renderedMap](cachedRenderSnapshots), } + + // Set initial indexer target. f.targetView = initView if f.indexedRange.initialized { f.indexedView = f.initChainView(f.targetView) @@ -314,7 +316,7 @@ func (f *FilterMaps) init() error { } } batch := f.db.NewBatch() - for epoch := 0; epoch < bestLen; epoch++ { + for epoch := range bestLen { cp := checkpoints[bestIdx][epoch] f.storeLastBlockOfMap(batch, (uint32(epoch+1)<