diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 8d33dfec74..d8e6013259 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { finished = append(finished, req) delete(active, pack.PeerId()) - // Handle dropped peer connections: + // Handle dropped peer connections: case p := <-peerDrop: // Skip if no request is currently pending req := active[p.id] @@ -399,7 +399,7 @@ func (s *stateSync) fillTasks(n int, req *stateReq) { // into a running state sync, re-queuing any items that were requested but not // delivered. func (s *stateSync) process(req *stateReq) error { - // Collect processing stats and update progress if valid data was received + // Collect processing stats duplicate, unexpected := 0, 0 defer func(start time.Time) { @@ -409,15 +409,12 @@ func (s *stateSync) process(req *stateReq) error { }(time.Now()) // Iterate over all the delivered data and inject one-by-one into the trie - progress := false - for _, blob := range req.response { - prog, hash, err := s.processNodeData(blob) + _, hash, err := s.processNodeData(blob) switch err { case nil: s.numUncommitted++ s.bytesUncommitted += len(blob) - progress = progress || prog case trie.ErrNotRequested: unexpected++ case trie.ErrAlreadyProcessed: