miner: initialize maps with capacity (#27228)

* miner : initialize maps with known size

* miner:some reverts
This commit is contained in:
ucwong 2023-05-09 01:24:43 -06:00 committed by GitHub
parent 5021d36d35
commit c798507642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -628,7 +628,7 @@ func (w *worker) mainLoop() {
if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas {
continue
}
txs := make(map[common.Address]types.Transactions)
txs := make(map[common.Address]types.Transactions, len(ev.Txs))
for _, tx := range ev.Txs {
acc, _ := types.Sender(w.current.signer, tx)
txs[acc] = append(txs[acc], tx)