Merge pull request #720 from gzliudan/fix-s1033

eth/downloader: fix staticcheck warning S1033: unnecessary guard around call to delete
This commit is contained in:
Daniel Liu 2024-10-31 21:47:00 +08:00 committed by GitHub
commit cea75c625a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -419,10 +419,8 @@ func (s *stateSync) process(req *stateReq) error {
default: default:
return fmt.Errorf("invalid state node %s: %v", hash.TerminalString(), err) return fmt.Errorf("invalid state node %s: %v", hash.TerminalString(), err)
} }
if _, ok := req.tasks[hash]; ok {
delete(req.tasks, hash) delete(req.tasks, hash)
} }
}
// Put unfulfilled tasks back into the retry queue // Put unfulfilled tasks back into the retry queue
npeers := s.d.peers.Len() npeers := s.d.peers.Len()
for hash, task := range req.tasks { for hash, task := range req.tasks {