From 49c2816d5464ed208389d52ed7cf47f35630b1c2 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 11 Jan 2021 12:53:13 +0100 Subject: [PATCH] eth: improve log message (#22146) * eth: fixed typos * eth: fixed log message --- eth/handler.go | 6 +++--- eth/peerset.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 76a429f6d..a9506c499 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -437,14 +437,14 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool) // Broadcast transactions to a batch of peers not knowing about it if propagate { for _, tx := range txs { - peers := h.peers.ethPeersWithoutTransacion(tx.Hash()) + peers := h.peers.ethPeersWithoutTransaction(tx.Hash()) // Send the block to a subset of our peers transfer := peers[:int(math.Sqrt(float64(len(peers))))] for _, peer := range transfer { txset[peer] = append(txset[peer], tx.Hash()) } - log.Trace("Broadcast transaction", "hash", tx.Hash(), "recipients", len(peers)) + log.Trace("Broadcast transaction", "hash", tx.Hash(), "recipients", len(transfer)) } for peer, hashes := range txset { peer.AsyncSendTransactions(hashes) @@ -453,7 +453,7 @@ func (h *handler) BroadcastTransactions(txs types.Transactions, propagate bool) } // Otherwise only broadcast the announcement to peers for _, tx := range txs { - peers := h.peers.ethPeersWithoutTransacion(tx.Hash()) + peers := h.peers.ethPeersWithoutTransaction(tx.Hash()) for _, peer := range peers { annos[peer] = append(annos[peer], tx.Hash()) } diff --git a/eth/peerset.go b/eth/peerset.go index 9b584ec32..bf5785ff3 100644 --- a/eth/peerset.go +++ b/eth/peerset.go @@ -243,9 +243,9 @@ func (ps *peerSet) ethPeersWithoutBlock(hash common.Hash) []*ethPeer { return list } -// ethPeersWithoutTransacion retrieves a list of `eth` peers that do not have a +// ethPeersWithoutTransaction retrieves a list of `eth` peers that do not have a // given transaction in their set of known hashes. -func (ps *peerSet) ethPeersWithoutTransacion(hash common.Hash) []*ethPeer { +func (ps *peerSet) ethPeersWithoutTransaction(hash common.Hash) []*ethPeer { ps.lock.RLock() defer ps.lock.RUnlock()