mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core, eth: fix review noticed bugs
This commit is contained in:
parent
67bddf61a5
commit
8bfdab3ec6
2 changed files with 2 additions and 6 deletions
|
|
@ -1169,7 +1169,7 @@ func (p *BlobPool) Add(txs []*types.Transaction, local bool, sync bool) []error
|
||||||
)
|
)
|
||||||
for i, tx := range txs {
|
for i, tx := range txs {
|
||||||
errs[i] = p.add(tx)
|
errs[i] = p.add(tx)
|
||||||
if errs[0] == nil {
|
if errs[i] == nil {
|
||||||
adds = append(adds, tx.WithoutBlobTxSidecar())
|
adds = append(adds, tx.WithoutBlobTxSidecar())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -609,14 +609,10 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) {
|
||||||
)
|
)
|
||||||
// Broadcast transactions to a batch of peers not knowing about it
|
// Broadcast transactions to a batch of peers not knowing about it
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
// Blob transactions are never broadcast, only ever announced
|
|
||||||
if tx.Type() == types.BlobTxType {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
peers := h.peers.peersWithoutTransaction(tx.Hash())
|
peers := h.peers.peersWithoutTransaction(tx.Hash())
|
||||||
|
|
||||||
var numDirect int
|
var numDirect int
|
||||||
if tx.Size() <= txMaxBroadcastSize {
|
if tx.Type() != types.BlobTxType && tx.Size() <= txMaxBroadcastSize {
|
||||||
numDirect = int(math.Sqrt(float64(len(peers))))
|
numDirect = int(math.Sqrt(float64(len(peers))))
|
||||||
}
|
}
|
||||||
// Send the tx unconditionally to a subset of our peers
|
// Send the tx unconditionally to a subset of our peers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue