From 91a85de0d4bc2d2c35b334bdde02d9f849e3c424 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Sat, 22 Mar 2025 01:47:58 +0100 Subject: [PATCH] core/filtermaps: initialize indexer when chain head is available --- core/filtermaps/indexer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/filtermaps/indexer.go b/core/filtermaps/indexer.go index 69f42d8b60..9e3ebf7813 100644 --- a/core/filtermaps/indexer.go +++ b/core/filtermaps/indexer.go @@ -42,6 +42,11 @@ func (f *FilterMaps) indexerLoop() { for !f.stop { if !f.indexedRange.initialized { + if f.targetView.headNumber == 0 { + // initialize when chain head is available + f.processSingleEvent(true) + continue + } if err := f.init(); err != nil { log.Error("Error initializing log index", "error", err) // unexpected error; there is not a lot we can do here, maybe it