From 85569ebb607f207334d42b10e12aca24e9a9b8bd Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 6 Jan 2021 10:25:35 -0500 Subject: [PATCH] blockchain v0: remove BroadcastStatusRequest --- blockchain/v0/reactor.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/blockchain/v0/reactor.go b/blockchain/v0/reactor.go index 5fc065942..d7904aa97 100644 --- a/blockchain/v0/reactor.go +++ b/blockchain/v0/reactor.go @@ -345,14 +345,6 @@ func (r *Reactor) processPeerUpdates() { } } -// BroadcastStatusRequest broadcasts a StatusRequest envelope. -func (r *Reactor) BroadcastStatusRequest() { - r.blockchainCh.Out() <- p2p.Envelope{ - Broadcast: true, - Message: &bcproto.StatusRequest{}, - } -} - // SwitchToFastSync is called by the state sync reactor when switching to fast // sync. func (r *Reactor) SwitchToFastSync(state sm.State) error { @@ -418,7 +410,12 @@ func (r *Reactor) poolRoutine(stateSynced bool) { case <-statusUpdateTicker.C: // ask for status updates - go r.BroadcastStatusRequest() + go func() { + r.blockchainCh.Out() <- p2p.Envelope{ + Broadcast: true, + Message: &bcproto.StatusRequest{}, + } + }() } } }()