From fff6df257e0ace88a5b596c0bddf679063a0edc3 Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Mon, 23 Sep 2019 08:49:11 +0900 Subject: [PATCH] increased block announcement queue to reduce the chance of losing them --- eth/peer.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eth/peer.go b/eth/peer.go index f6b340e6061f..5e2f97d20395 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -52,12 +52,12 @@ const ( // maxQueuedProps is the maximum number of block propagations to queue up before // dropping broadcasts. There's not much point in queueing stale blocks, so a few // that might cover uncles should be enough. - maxQueuedProps = 4 + maxQueuedProps = 1024 // maxQueuedAnns is the maximum number of block announcements to queue up before // dropping broadcasts. Similarly to block propagations, there's no point to queue // above some healthy uncle limit, so use that. - maxQueuedAnns = 4 + maxQueuedAnns = 1024 handshakeTimeout = 5 * time.Second ) @@ -134,11 +134,6 @@ func (p *peer) broadcast() { for { select { - case txs := <-p.queuedTxs: - for _, i := range txs { - b.Put(i) - } - case prop := <-p.queuedProps: if err := p.SendNewBlock(prop.block, prop.td); err != nil { return @@ -151,6 +146,11 @@ func (p *peer) broadcast() { } p.Log().Trace("Announced block", "number", block.Number(), "hash", block.Hash()) + case txs := <-p.queuedTxs: + for _, i := range txs { + b.Put(i) + } + case <-p.term: return }