From 5986532b55f8f600b497a394cc04055f5a50505f Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Sat, 20 Sep 2025 13:25:33 +0800 Subject: [PATCH] core/txpool: using slices.SortFunc --- core/txpool/blobpool/blobpool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 1bf48cf949..38db1e1d92 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -25,7 +25,7 @@ import ( "math/big" "os" "path/filepath" - "sort" + "slices" "sync" "sync/atomic" "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 return } - sort.Slice(txs, func(i, j int) bool { - return txs[i].nonce < txs[j].nonce + slices.SortFunc(txs, func(txsI, txsJ *blobTxMeta) int { + return int(txsI.nonce) - int(txsJ.nonce) }) // 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