eth/protocols/snap: fix reverse sort method call

This commit is contained in:
Péter Szilágyi 2021-05-17 19:54:15 +03:00
parent 14c2574d4a
commit 5ccfe56dd7
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D
1 changed files with 5 additions and 5 deletions

View File

@ -874,7 +874,7 @@ func (s *Syncer) assignAccountTasks(success chan *accountResponse, fail chan *ac
if len(idlers.ids) == 0 {
return
}
sort.Reverse(idlers)
sort.Sort(sort.Reverse(idlers))
// Iterate over all the tasks and try to find a pending one
for _, task := range s.tasks {
@ -971,7 +971,7 @@ func (s *Syncer) assignBytecodeTasks(success chan *bytecodeResponse, fail chan *
if len(idlers.ids) == 0 {
return
}
sort.Reverse(idlers)
sort.Sort(sort.Reverse(idlers))
// Iterate over all the tasks and try to find a pending one
for _, task := range s.tasks {
@ -1074,7 +1074,7 @@ func (s *Syncer) assignStorageTasks(success chan *storageResponse, fail chan *st
if len(idlers.ids) == 0 {
return
}
sort.Reverse(idlers)
sort.Sort(sort.Reverse(idlers))
// Iterate over all the tasks and try to find a pending one
for _, task := range s.tasks {
@ -1230,7 +1230,7 @@ func (s *Syncer) assignTrienodeHealTasks(success chan *trienodeHealResponse, fai
if len(idlers.ids) == 0 {
return
}
sort.Reverse(idlers)
sort.Sort(sort.Reverse(idlers))
// Iterate over pending tasks and try to find a peer to retrieve with
for len(s.healer.trieTasks) > 0 || s.healer.scheduler.Pending() > 0 {
@ -1354,7 +1354,7 @@ func (s *Syncer) assignBytecodeHealTasks(success chan *bytecodeHealResponse, fai
if len(idlers.ids) == 0 {
return
}
sort.Reverse(idlers)
sort.Sort(sort.Reverse(idlers))
// Iterate over pending tasks and try to find a peer to retrieve with
for len(s.healer.codeTasks) > 0 || s.healer.scheduler.Pending() > 0 {