trie: fix gosimple lint issue #25309 (#1097)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Daniel Liu 2025-08-26 15:44:53 +08:00 committed by GitHub
parent 152e3d9923
commit 67106daaa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,17 +250,16 @@ func (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) {
s.queue.Pop()
s.fetches[depth]++
switch item.(type) {
switch item := item.(type) {
case common.Hash:
codeHashes = append(codeHashes, item.(common.Hash))
codeHashes = append(codeHashes, item)
case string:
path := item.(string)
req, ok := s.nodeReqs[path]
req, ok := s.nodeReqs[item]
if !ok {
log.Error("Missing node request", "path", path)
log.Error("Missing node request", "path", item)
continue // System very wrong, shouldn't happen
}
nodePaths = append(nodePaths, path)
nodePaths = append(nodePaths, item)
nodeHashes = append(nodeHashes, req.hash)
}
}