From 0d271ae5af1c6cb356800e67e289cbfbc3d369ee Mon Sep 17 00:00:00 2001 From: 9547 <29431502+9547@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:25:09 +0800 Subject: [PATCH] eth/downloader: alloc mem for context --- eth/downloader/skeleton.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/downloader/skeleton.go b/eth/downloader/skeleton.go index 04421a2bf5..56980c18ab 100644 --- a/eth/downloader/skeleton.go +++ b/eth/downloader/skeleton.go @@ -1024,7 +1024,7 @@ func (s *skeleton) processResponse(res *headerResponse) (linked bool, merged boo // the syncer's internal state is corrupted. Do try to fix it, but // be very vocal about the fault. default: - var context []interface{} + context := make([]interface{}, 0, len(s.progress.Subchains[1:])*6) for i := range s.progress.Subchains[1:] { context = append(context, fmt.Sprintf("stale_head_%d", i+1))