mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core/txpool: using slices.SortFunc
This commit is contained in:
parent
684f0db4a2
commit
5986532b55
1 changed files with 3 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"slices"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -560,8 +560,8 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6
|
||||||
if inclusions != nil && txs == nil { // during reorgs, we might find new accounts
|
if inclusions != nil && txs == nil { // during reorgs, we might find new accounts
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sort.Slice(txs, func(i, j int) bool {
|
slices.SortFunc(txs, func(txsI, txsJ *blobTxMeta) int {
|
||||||
return txs[i].nonce < txs[j].nonce
|
return int(txsI.nonce) - int(txsJ.nonce)
|
||||||
})
|
})
|
||||||
// If there is a gap between the chain state and the blob pool, drop
|
// If there is a gap between the chain state and the blob pool, drop
|
||||||
// all the transactions as they are non-executable. Similarly, if the
|
// all the transactions as they are non-executable. Similarly, if the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue