Skip to content

Commit 0712715

Browse files
authored
filtermaps support history pruning cutoff point
1 parent 447b5f7 commit 0712715

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/filtermaps/filtermaps.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (f *FilterMaps) init() error {
393393
bestIdx, bestLen = idx, max
394394
}
395395
}
396-
var initBlockNumber uint64
396+
initBlockNumber := f.historyCutoff
397397
if bestLen > 0 {
398398
initBlockNumber = checkpoints[bestIdx][bestLen-1].BlockNumber
399399
}
@@ -503,7 +503,7 @@ func (f *FilterMaps) getLogByLvIndex(lvIndex uint64) (*types.Log, error) {
503503
if err != nil {
504504
return nil, fmt.Errorf("failed to retrieve last block of map %d containing searched log value index %d: %v", mapIndex, lvIndex, err)
505505
}
506-
var firstBlockNumber uint64
506+
firstBlockNumber := f.historyCutoff
507507
if mapIndex > 0 {
508508
firstBlockNumber, _, err = f.getLastBlockOfMap(mapIndex - 1)
509509
if err != nil {
@@ -763,7 +763,7 @@ func (f *FilterMaps) deleteTailEpoch(epoch uint32) (bool, error) {
763763
if err != nil {
764764
return false, fmt.Errorf("failed to retrieve last block of deleted epoch %d: %v", epoch, err)
765765
}
766-
var firstBlock uint64
766+
firstBlock := f.historyCutoff
767767
firstMap := f.firstEpochMap(epoch)
768768
if epoch > 0 {
769769
firstBlock, _, err = f.getLastBlockOfMap(firstMap - 1)

0 commit comments

Comments
 (0)