core/txpool : fix map size avoid resizing #27221 (#1861)

This commit is contained in:
Daniel Liu 2025-12-15 16:33:56 +08:00 committed by GitHub
parent 7f89733a09
commit 322ec7f997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -568,7 +568,7 @@ func (pool *TxPool) Pending(enforceTips bool) map[common.Address]types.Transacti
pool.mu.Lock()
defer pool.mu.Unlock()
pending := make(map[common.Address]types.Transactions)
pending := make(map[common.Address]types.Transactions, len(pool.pending))
for addr, list := range pool.pending {
txs := list.Flatten()