From bbf0ed3c6cd01b1a75854f42315011957ef9dfc2 Mon Sep 17 00:00:00 2001 From: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com> Date: Thu, 19 May 2022 15:25:22 +0800 Subject: [PATCH] core: fix the order of address in queue (#24907) reverse the order of address in queue --- core/tx_pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index 31b0690739..cceb56530e 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -1529,7 +1529,7 @@ func (pool *TxPool) truncateQueue() { addresses = append(addresses, addressByHeartbeat{addr, pool.beats[addr]}) } } - sort.Sort(addresses) + sort.Sort(sort.Reverse(addresses)) // Drop transactions until the total is below the limit or only locals remain for drop := queued - pool.config.GlobalQueue; drop > 0 && len(addresses) > 0; {