core, eth: fix review noticed bugs

This commit is contained in:
Péter Szilágyi 2023-10-04 10:06:23 +03:00
parent 67bddf61a5
commit 8bfdab3ec6
2 changed files with 2 additions and 6 deletions

View file

@ -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())
}
}

View file

@ -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