Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nil handling #10515

Merged
merged 2 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions erigon-lib/state/aggregator_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type SelectedStaticFilesV3 struct {
dHist [kv.DomainLen][]*filesItem
dIdx [kv.DomainLen][]*filesItem
dI [kv.DomainLen]int
ii [kv.StandaloneIdxLen]*filesItemI
ii [kv.StandaloneIdxLen]filesItemI
}

func (sf SelectedStaticFilesV3) Close() {
Expand All @@ -45,9 +45,6 @@ func (sf SelectedStaticFilesV3) Close() {
}

for _, i := range sf.ii {
if i == nil {
continue
}
clist = append(clist, i.fi)
}
for _, group := range clist {
Expand All @@ -73,7 +70,8 @@ func (ac *AggregatorRoTx) staticFilesInRange(r RangesV3) (sf SelectedStaticFiles
for id, rng := range r.ranges {
if rng != nil && rng.needMerge {
fi, i := ac.iis[id].staticFilesInRange(rng.from, rng.to)
sf.ii[id] = &filesItemI{fi, i}
sf.ii[id].fi = fi
sf.ii[id].i = i
}
}
return sf, err
Expand Down
Loading