core/txpool/legacypool: remove redundant check for floatingRatio #27477 (#1913)

This commit is contained in:
Daniel Liu 2026-01-13 19:21:21 +08:00 committed by GitHub
parent 4addc980f4
commit a7ddd8ac03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -618,7 +618,7 @@ func (l *pricedList) underpricedFor(h *priceHeap, tx *types.Transaction) bool {
func (l *pricedList) Discard(slots int, force bool) (types.Transactions, bool) {
drop := make(types.Transactions, 0, slots) // Remote underpriced transactions to drop
for slots > 0 {
if len(l.urgent.list)*floatingRatio > len(l.floating.list)*urgentRatio || floatingRatio == 0 {
if len(l.urgent.list)*floatingRatio > len(l.floating.list)*urgentRatio {
// Discard stale transactions if found during cleanup
tx := heap.Pop(&l.urgent).(*types.Transaction)
if l.all.GetRemote(tx.Hash()) == nil { // Removed or migrated