blockchain v0: refactor BroadcastStatusRequest

This commit is contained in:
Aleksandr Bezobchuk
2021-01-04 16:36:34 -05:00
parent bbf126a79d
commit c978c8f4ee

View File

@@ -349,6 +349,14 @@ func (r *Reactor) processPeerUpdates() {
}
}
// BroadcastStatusRequest broadcasts a StatusRequest envelope.
func (r *Reactor) BroadcastStatusRequest() {
r.blockchainCh.Out() <- p2p.Envelope{
Broadcast: true,
Message: &bcproto.StatusRequest{},
}
}
// ============================================================================
// ============================================================================
// ============================================================================
@@ -552,15 +560,3 @@ FOR_LOOP:
}
}
}
// BroadcastStatusRequest broadcasts `BlockStore` base and height.
func (bcR *BlockchainReactor) BroadcastStatusRequest() {
bm, err := bc.EncodeMsg(&bcproto.StatusRequest{})
if err != nil {
bcR.Logger.Error("could not convert StatusRequest to proto", "err", err)
return
}
// We don't care about whenever broadcast is successful or not.
_ = bcR.Switch.Broadcast(BlockchainChannel, bm)
}