eth/downloader: fix staticcheck warning S1033: unnecessary guard for delete

This commit is contained in:
Daniel Liu 2024-10-31 15:31:48 +08:00
parent 003af00b25
commit af40f2e194

View file

@ -419,9 +419,7 @@ func (s *stateSync) process(req *stateReq) error {
default:
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
npeers := s.d.peers.Len()