diff --git a/core/filtermaps/indexer.go b/core/filtermaps/indexer.go index 61a9bf0352..4c31d24910 100644 --- a/core/filtermaps/indexer.go +++ b/core/filtermaps/indexer.go @@ -356,15 +356,17 @@ func (f *FilterMaps) needTailEpoch(epoch uint32) bool { if epoch+1 < firstEpoch { return false } + var lastBlockOfPrevEpoch uint64 if epoch > 0 { - lastBlockOfPrevEpoch, _, err := f.getLastBlockOfMap(epoch<= firstEpoch } - if f.historyCutoff > lastBlockOfPrevEpoch { - return false - } + } + if f.historyCutoff > lastBlockOfPrevEpoch { + return false } lastBlockOfEpoch, _, err := f.getLastBlockOfMap((epoch+1)<