stagedsync: borheimdall segments min check minor improvement (#9168)

This commit is contained in:
milen 2024-01-08 18:37:22 +00:00 committed by GitHub
parent b4e6563e4a
commit 19b9504039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,7 +322,10 @@ func BorHeimdallForward(
var snap *bor.Snapshot
if header != nil {
if cfg.blockReader.BorSnapshots().SegmentsMin() == 0 {
if blockNum > cfg.blockReader.BorSnapshots().SegmentsMin() {
// SegmentsMin is only set if running as an uploader process (check SnapshotsCfg.snapshotUploader and
// UploadLocationFlag) when we remove snapshots based on FrozenBlockLimit and number of uploaded snapshots
// avoid calling this if block for blockNums <= SegmentsMin to avoid reinsertion of snapshots
snap = loadSnapshot(blockNum, header.Hash(), cfg.borConfig, recents, signatures, cfg.snapDb, logger)
if snap == nil {