core/filtermaps: initialize indexer when chain head is available

This commit is contained in:
Zsolt Felfoldi 2025-03-22 01:47:58 +01:00
parent 624a5d8b23
commit 91a85de0d4

View file

@ -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