func (conR *ConsensusReactor) SwitchToConsensus(state sm.State, blocksSynced int) {
	conR.Logger.Info("SwitchToConsensus")
	conR.conS.reconstructLastCommit(state)
	conR.conS.updateToState(state)
	conR.mtx.Lock()
	conR.fastSync = false
	conR.mtx.Unlock()
	if blocksSynced > 0 {
		conR.conS.doWALCatchup = false
	}
	err := conR.conS.Start()
	if err != nil {
		conR.Logger.Error("Error starting conS", "err", err)
		return
	}
}
SwitchToConsensus switches from fast_sync mode to consensus mode.
It resets the state, turns off fast_sync, and starts the consensus state-machine
package consensus
import (
	"fmt"
	"reflect"
	"sync"
	"time"
	"github.com/pkg/errors"
	amino "github.com/tendermint/go-amino"
	cstypes "github.com/tendermint/tendermint/consensus/types"
	cmn "github.com/tendermint/tendermint/libs/common"
	tmevents "github.com/tendermint/tendermint/libs/events"
	"github.com/tendermint/tendermint/libs/log"
	"github.com/tendermint/tendermint/p2p"
	sm "github.com/tendermint/tendermint/state"
	"github.com/tendermint/tendermint/types"
)
const (
	StateChannel       = byte(0x20)
	DataChannel        = byte(0x21)
	VoteChannel        = byte(0x22)
	VoteSetBitsChannel = byte(0x23)
	maxMsgSize = 1048576  
	blocksToContributeToBecomeGoodPeer = 10000
)
type ConsensusReactor struct {
	p2p.BaseReactor  
	conS *ConsensusState
	mtx      sync.RWMutex
	fastSync bool
	eventBus *types.EventBus
}
func NewConsensusReactor(consensusState *ConsensusState, fastSync bool) *ConsensusReactor {
	conR := &ConsensusReactor{
		conS:     consensusState,
		fastSync: fastSync,
	}
	conR.BaseReactor = *p2p.NewBaseReactor("ConsensusReactor", conR)
	return conR
}
func (conR *ConsensusReactor) OnStart() error {
	conR.Logger.Info("ConsensusReactor ", "fastSync", conR.FastSync())
	if err := conR.BaseReactor.OnStart(); err != nil {
		return err
	}
	conR.subscribeToBroadcastEvents()
	if !conR.FastSync() {
		err := conR.conS.Start()
		if err != nil {
			return err
		}
	}
	return nil
}
func (conR *ConsensusReactor) OnStop() {
	conR.BaseReactor.OnStop()
	conR.unsubscribeFromBroadcastEvents()
	conR.conS.Stop()
	if !conR.FastSync() {
		conR.conS.Wait()
	}
}