From d6170bfa53b34a882f6cae292c36dc88178680e4 Mon Sep 17 00:00:00 2001 From: Delweng Zheng Date: Mon, 29 Oct 2018 19:51:45 +0800 Subject: [PATCH] eth/downloader: progress in stateSync not used anymore --- eth/downloader/statesync.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 8d33dfec74e7..d8e6013259dc 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: