diff --git a/erigon-lib/chain/snapcfg/util.go b/erigon-lib/chain/snapcfg/util.go index 6a4c4099798..6a13bff1e6a 100644 --- a/erigon-lib/chain/snapcfg/util.go +++ b/erigon-lib/chain/snapcfg/util.go @@ -498,14 +498,14 @@ func KnownCfg(networkName string) *Cfg { return newCfg(networkName, c.Typed(knownTypes[networkName])) } -func VersionedCfg(networkName string, preferred snaptype.Version, min snaptype.Version) *Cfg { +func VersionedCfg(networkName string, preferred snaptype.Version, _min snaptype.Version) *Cfg { c, ok := knownPreverified[networkName] if !ok { return newCfg(networkName, Preverified{}) } - return newCfg(networkName, c.Versioned(preferred, min)) + return newCfg(networkName, c.Versioned(preferred, _min)) } var KnownWebseeds = map[string][]string{ diff --git a/erigon-lib/seg/decompress_test.go b/erigon-lib/seg/decompress_test.go index 9e6ba470323..1568b06f4d9 100644 --- a/erigon-lib/seg/decompress_test.go +++ b/erigon-lib/seg/decompress_test.go @@ -566,10 +566,6 @@ func generateRandWords() { WORDS[N-1] = []byte{} } -func randIntInRange(min, max int) int { - return (rand.Intn(max-min) + min) -} - func clearPrevDict() { WORDS = [N][]byte{} WORD_FLAGS = [N]bool{} diff --git a/eth/stagedsync/stage_snapshots.go b/eth/stagedsync/stage_snapshots.go index 269440a6a4b..f8e056623e9 100644 --- a/eth/stagedsync/stage_snapshots.go +++ b/eth/stagedsync/stage_snapshots.go @@ -1040,25 +1040,25 @@ func (u *snapshotUploader) downloadLatestSnapshots(ctx context.Context, blockNum } } - var min uint64 + var _min uint64 for _, info := range lastSegments { if lastInfo, ok := info.Sys().(downloader.SnapInfo); ok { - if min == 0 || lastInfo.From() < min { - min = lastInfo.From() + if _min == 0 || lastInfo.From() < _min { + _min = lastInfo.From() } } } for segType, info := range lastSegments { if lastInfo, ok := info.Sys().(downloader.SnapInfo); ok { - if lastInfo.From() > min { + if lastInfo.From() > _min { for _, ent := range entries { if info, err := ent.Info(); err == nil { snapInfo, ok := info.Sys().(downloader.SnapInfo) if ok && snapInfo.Type().Enum() == segType && - snapInfo.From() == min { + snapInfo.From() == _min { lastSegments[segType] = info } } @@ -1088,17 +1088,17 @@ func (u *snapshotUploader) maxSeedableHeader() uint64 { } func (u *snapshotUploader) minBlockNumber() uint64 { - var min uint64 + var _min uint64 if list, err := snaptype.Segments(u.cfg.dirs.Snap); err == nil { for _, info := range list { - if u.seedable(info) && min == 0 || info.From < min { - min = info.From + if u.seedable(info) && _min == 0 || info.From < _min { + _min = info.From } } } - return min + return _min } func expandHomeDir(dirpath string) string {