Skip to content

Commit

Permalink
feature: add tx send logs
Browse files Browse the repository at this point in the history
  • Loading branch information
redhdx committed Dec 27, 2023
1 parent 6ab0d2f commit 8ceef29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans
if pool.promoteTx(addr, hash, tx) {
promoted = append(promoted, tx)
}
log.Trace("Promoted queued transaction", "hash", hash)
}
log.Trace("Promoted queued transactions", "count", len(promoted))
queuedGauge.Dec(int64(len(readies)))
Expand Down
2 changes: 2 additions & 0 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,12 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) {
numDirect := int(math.Sqrt(float64(len(peers))))
for _, peer := range peers[:numDirect] {
txset[peer] = append(txset[peer], tx.Hash())
log.Trace("Broadcast transaction", "peer", peer.ID(), "hash", tx.Hash())
}
// For the remaining peers, send announcement only
for _, peer := range peers[numDirect:] {
annos[peer] = append(annos[peer], tx.Hash())
log.Trace("Announce transaction", "peer", peer.ID(), "hash", tx.Hash())
}
}
for peer, hashes := range txset {
Expand Down

0 comments on commit 8ceef29

Please sign in to comment.