From 8bfdab3ec6d47069bdfceff3285beb5b88e8b160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 4 Oct 2023 10:06:23 +0300 Subject: [PATCH] core, eth: fix review noticed bugs --- core/txpool/blobpool/blobpool.go | 2 +- eth/handler.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 69e0d2bde0..32c6c0e8fe 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -1169,7 +1169,7 @@ func (p *BlobPool) Add(txs []*types.Transaction, local bool, sync bool) []error ) for i, tx := range txs { errs[i] = p.add(tx) - if errs[0] == nil { + if errs[i] == nil { adds = append(adds, tx.WithoutBlobTxSidecar()) } } diff --git a/eth/handler.go b/eth/handler.go index de9c08be6a..b849ee31d0 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -609,14 +609,10 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) { ) // Broadcast transactions to a batch of peers not knowing about it for _, tx := range txs { - // Blob transactions are never broadcast, only ever announced - if tx.Type() == types.BlobTxType { - continue - } peers := h.peers.peersWithoutTransaction(tx.Hash()) var numDirect int - if tx.Size() <= txMaxBroadcastSize { + if tx.Type() != types.BlobTxType && tx.Size() <= txMaxBroadcastSize { numDirect = int(math.Sqrt(float64(len(peers)))) } // Send the tx unconditionally to a subset of our peers