mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-31 21:27:04 +00:00
libs/events: remove unneccessary unsubscription code (#8135)
The events switch code is largely vestigal and is responsible for wiring between the consensus state machine and the consensus reactor. While there might have been a need, historicallly to managed these subscriptions at runtime, it's nolonger used: subscriptions are registered during startup, and then the switch shuts down at at the end. Eventually the EventSwitch should be replaced by a much smaller implementation of an eventloop in the consensus state machine, but cutting down on the scope of the event switch will help clarify the requirements from the consensus side.
This commit is contained in:
@@ -219,8 +219,6 @@ func (r *Reactor) OnStart(ctx context.Context) error {
|
||||
// blocking until they all exit, as well as unsubscribing from events and stopping
|
||||
// state.
|
||||
func (r *Reactor) OnStop() {
|
||||
r.unsubscribeFromBroadcastEvents()
|
||||
|
||||
r.state.Stop()
|
||||
|
||||
if !r.WaitSync() {
|
||||
@@ -394,10 +392,6 @@ func (r *Reactor) subscribeToBroadcastEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Reactor) unsubscribeFromBroadcastEvents() {
|
||||
r.state.evsw.RemoveListener(listenerIDConsensus)
|
||||
}
|
||||
|
||||
func makeRoundStepMessage(rs *cstypes.RoundState) *tmcons.NewRoundStep {
|
||||
return &tmcons.NewRoundStep{
|
||||
Height: rs.Height,
|
||||
|
||||
Reference in New Issue
Block a user