good morning!!!!

Skip to content
Snippets Groups Projects
Commit 9c42a41e authored by Péter Szilágyi's avatar Péter Szilágyi Committed by Felix Lange
Browse files

eth/downloader: avoid hidden reference to finished statesync request (#15545)

parent 2fe07c20
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,10 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
// Send the next finished request to the current sync:
case deliverReqCh <- deliverReq:
finished = append(finished[:0], finished[1:]...)
// Shift out the first request, but also set the emptied slot to nil for GC
copy(finished, finished[1:])
finished[len(finished)-1] = nil
finished = finished[:len(finished)-1]
// Handle incoming state packs:
case pack := <-d.stateCh:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment