Skip to content

Commit

Permalink
Merge branch 'index_once' into e3_dbg_bor_retire
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed May 28, 2024
2 parents 062d0ab + bc74107 commit fbc45b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eth/stagedsync/stage_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ func SpawnStageSnapshots(
return nil
}

var downaloadedOnce = false //temporary fix for the fact that E3 does pass `initialCycle=true` multiple times. Need split it to 2 variables: isFirstCycle, isOnChainTip
func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.RwTx, cfg SnapshotsCfg, initialCycle bool, logger log.Logger) error {
if !initialCycle {
if !initialCycle || downaloadedOnce {
return nil
}
if !cfg.blockReader.FreezingCfg().Enabled {
Expand Down Expand Up @@ -300,6 +301,7 @@ func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.R
})
}

downaloadedOnce = true
return nil
}

Expand Down

0 comments on commit fbc45b3

Please sign in to comment.