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

This commit is contained in:
ucwong 2023-05-05 03:33:01 -06:00 committed by GitHub
parent 79a57d49cb
commit ba09403113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,7 +549,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()