core/txpool: should not substraction between uint64

This commit is contained in:
Weixie Cui 2026-05-10 07:32:32 +08:00
parent 1abbae239d
commit d4ca7cbc26

View file

@ -18,6 +18,7 @@
package locals package locals
import ( import (
"cmp"
"slices" "slices"
"sync" "sync"
"time" "time"
@ -151,7 +152,7 @@ func (tracker *TxTracker) recheck(journalCheck bool) []*types.Transaction {
for _, list := range rejournal { for _, list := range rejournal {
// cmp(a, b) should return a negative number when a < b, // cmp(a, b) should return a negative number when a < b,
slices.SortFunc(list, func(a, b *types.Transaction) int { slices.SortFunc(list, func(a, b *types.Transaction) int {
return int(a.Nonce() - b.Nonce()) return cmp.Compare(a.Nonce(), b.Nonce())
}) })
} }
// Rejournal the tracker while holding the lock. No new transactions will // Rejournal the tracker while holding the lock. No new transactions will