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

Update stage_finish.go : notifications to rpc daemon #2755

Merged
merged 8 commits into from
Oct 4, 2021
Merged
6 changes: 5 additions & 1 deletion eth/stagedsync/stage_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func NotifyNewHeaders(ctx context.Context, finishStageBeforeSync uint64, unwindT
return nil
}

for i := notifyFrom; i <= notifyTo; i++ {
i := notifyFrom
if notifyTo-notifyFrom > 1024 {
i = notifyTo
}
for ; i <= notifyTo; i++ {
header := rawdb.ReadHeaderByNumber(tx, i)
if header == nil {
return fmt.Errorf("could not find canonical header for number: %d", i)
Expand Down