eth: prealloc seen map in handleTransactions (#35237)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

This commit is contained in:
cui 2026-07-01 10:34:08 +08:00 committed by GitHub
parent b6e2f13a9a
commit dd672c6867
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ func (h *ethHandler) Handle(peer *eth.Peer, packet eth.Packet) error {
// handleTransactions marks all given transactions as known to the peer
// and performs basic validations.
func handleTransactions(peer *eth.Peer, list []*types.Transaction, directBroadcast bool) error {
seen := make(map[common.Hash]struct{})
seen := make(map[common.Hash]struct{}, len(list))
for _, tx := range list {
if tx.Type() == types.BlobTxType {
if directBroadcast {