@@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
152152 finished = append (finished , req )
153153 delete (active , pack .PeerId ())
154154
155- // Handle dropped peer connections:
155+ // Handle dropped peer connections:
156156 case p := <- peerDrop :
157157 // Skip if no request is currently pending
158158 req := active [p .id ]
@@ -398,9 +398,8 @@ func (s *stateSync) fillTasks(n int, req *stateReq) {
398398
399399// process iterates over a batch of delivered state data, injecting each item
400400// into a running state sync, re-queuing any items that were requested but not
401- // delivered.
402- // Returns whether the peer actually managed to deliver anything of value,
403- // and any error that occurred
401+ // delivered. Returns whether the peer actually managed to deliver anything of
402+ // value, and any error that occurred.
404403func (s * stateSync ) process (req * stateReq ) (int , error ) {
405404 // Collect processing stats and update progress if valid data was received
406405 duplicate , unexpected , successful := 0 , 0 , 0
@@ -412,14 +411,12 @@ func (s *stateSync) process(req *stateReq) (int, error) {
412411 }(time .Now ())
413412
414413 // Iterate over all the delivered data and inject one-by-one into the trie
415- progress := false
416414 for _ , blob := range req .response {
417- prog , hash , err := s .processNodeData (blob )
415+ _ , hash , err := s .processNodeData (blob )
418416 switch err {
419417 case nil :
420418 s .numUncommitted ++
421419 s .bytesUncommitted += len (blob )
422- progress = progress || prog
423420 successful ++
424421 case trie .ErrNotRequested :
425422 unexpected ++
0 commit comments