core/types: remove BlockBy sorting code (#20355)
This commit is contained in:
committed by
Péter Szilágyi
parent
0ec5ab4175
commit
b6d4f6b66e
@ -23,6 +23,7 @@ import (
|
||||
"io"
|
||||
"math/big"
|
||||
mrand "math/rand"
|
||||
"sort"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@ -855,8 +856,9 @@ func (bc *BlockChain) procFutureBlocks() {
|
||||
}
|
||||
}
|
||||
if len(blocks) > 0 {
|
||||
types.BlockBy(types.Number).Sort(blocks)
|
||||
|
||||
sort.Slice(blocks, func(i, j int) bool {
|
||||
return blocks[i].NumberU64() < blocks[j].NumberU64()
|
||||
})
|
||||
// Insert one by one as chain insertion needs contiguous ancestry between blocks
|
||||
for i := range blocks {
|
||||
bc.InsertChain(blocks[i : i+1])
|
||||
|
Reference in New Issue
Block a user