mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth: fix review comments
This commit is contained in:
parent
b3b028174a
commit
29389ee8a7
1 changed files with 4 additions and 3 deletions
|
|
@ -627,7 +627,7 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) {
|
||||||
total := new(big.Int).Exp(direct, big.NewInt(2), nil) // Stabilise total peer count a bit based on sqrt peers
|
total := new(big.Int).Exp(direct, big.NewInt(2), nil) // Stabilise total peer count a bit based on sqrt peers
|
||||||
|
|
||||||
var (
|
var (
|
||||||
signer = types.LatestSignerForChainID(h.chain.Config().ChainID) // Don't care about chain status, we ust need *a* sender
|
signer = types.LatestSignerForChainID(h.chain.Config().ChainID) // Don't care about chain status, we just need *a* sender
|
||||||
hasher = sha3.NewLegacyKeccak256().(crypto.KeccakState)
|
hasher = sha3.NewLegacyKeccak256().(crypto.KeccakState)
|
||||||
hash = make([]byte, 32)
|
hash = make([]byte, 32)
|
||||||
)
|
)
|
||||||
|
|
@ -645,8 +645,9 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) {
|
||||||
// the peers that have not received it yet, ensuring that the flow of
|
// the peers that have not received it yet, ensuring that the flow of
|
||||||
// transactions is groupped by account to (try and) avoid nonce gaps.
|
// transactions is groupped by account to (try and) avoid nonce gaps.
|
||||||
//
|
//
|
||||||
// To do this, we hash a peer's enode ID together with the transaction
|
// To do this, we hash the local enode IW with together with a peer's
|
||||||
// sender and broadcast if `sha(peer, sender) mod peers < sqrt(peers)`.
|
// enode ID together with the transaction sender and broadcast if
|
||||||
|
// `sha(self, peer, sender) mod peers < sqrt(peers)`.
|
||||||
for _, peer := range h.peers.peersWithoutTransaction(tx.Hash()) {
|
for _, peer := range h.peers.peersWithoutTransaction(tx.Hash()) {
|
||||||
var broadcast bool
|
var broadcast bool
|
||||||
if maybeDirect {
|
if maybeDirect {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue