@@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
152
152
finished = append (finished , req )
153
153
delete (active , pack .PeerId ())
154
154
155
- // Handle dropped peer connections:
155
+ // Handle dropped peer connections:
156
156
case p := <- peerDrop :
157
157
// Skip if no request is currently pending
158
158
req := active [p .id ]
@@ -398,9 +398,8 @@ func (s *stateSync) fillTasks(n int, req *stateReq) {
398
398
399
399
// process iterates over a batch of delivered state data, injecting each item
400
400
// 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.
404
403
func (s * stateSync ) process (req * stateReq ) (int , error ) {
405
404
// Collect processing stats and update progress if valid data was received
406
405
duplicate , unexpected , successful := 0 , 0 , 0
@@ -412,14 +411,12 @@ func (s *stateSync) process(req *stateReq) (int, error) {
412
411
}(time .Now ())
413
412
414
413
// Iterate over all the delivered data and inject one-by-one into the trie
415
- progress := false
416
414
for _ , blob := range req .response {
417
- prog , hash , err := s .processNodeData (blob )
415
+ _ , hash , err := s .processNodeData (blob )
418
416
switch err {
419
417
case nil :
420
418
s .numUncommitted ++
421
419
s .bytesUncommitted += len (blob )
422
- progress = progress || prog
423
420
successful ++
424
421
case trie .ErrNotRequested :
425
422
unexpected ++
0 commit comments