// NewReactor returns a reference to a new consensus reactor, which implements
// the service.Service interface. It accepts a logger, consensus state, references
// to relevant p2p Channels and a channel to listen for peer updates on. The
// reactor will close all p2p Channels when stopping.
NewReactor returns a reference to a new consensus reactor, which implements
the service.Service interface. It accepts a logger, consensus state, references
to relevant p2p Channels and a channel to listen for peer updates on. The
reactor will close all p2p Channels when stopping.
// NewReactor returns a reference to a new consensus reactor which implements // the service . Service interface . It accepts a logger consensus state references // to relevant p2p Channels and a channel to listen for peer updates on . The // reactor will close all p2p Channels when stopping .
func NewReactor(
	logger log.Logger,
	cs *State,
	stateCh *p2p.Channel,
	dataCh *p2p.Channel,
	voteCh *p2p.Channel,
	voteSetBitsCh *p2p.Channel,
	peerUpdates *p2p.PeerUpdates,
	waitSync bool,
	options ...ReactorOption,
) *Reactor {
	r := &Reactor{
		state:         cs,
		waitSync:      waitSync,
		peers:         make(map[types.NodeID]*PeerState),
		Metrics:       NopMetrics(),
		stateCh:       stateCh,
		dataCh:        dataCh,
		voteCh:        voteCh,
		voteSetBitsCh: voteSetBitsCh,
		peerUpdates:   peerUpdates,
		stateCloseCh:  make(chan struct{}),
		closeCh:       make(chan struct{}),
	}
	r.BaseService = *service.NewBaseService(logger, "Consensus", r)
	for _, opt := range options {
		opt(r)
	}
	return r
}
func NewReactor ( logger log . Logger , cs * State , stateCh * p2p . Channel , dataCh * p2p . Channel , voteCh * p2p . Channel , voteSetBitsCh * p2p . Channel , peerUpdates * p2p . PeerUpdates , waitSync bool , options ... ReactorOption , ) * Reactor { r := & Reactor { state : cs , waitSync : waitSync , peers : make ( map [ types . NodeID ] * PeerState ) , Metrics : NopMetrics ( ) , stateCh : stateCh , dataCh : dataCh , voteCh : voteCh , voteSetBitsCh : voteSetBitsCh , peerUpdates : peerUpdates , stateCloseCh : make ( chan struct { } ) , closeCh : make ( chan struct { } ) , } r . BaseService = * service . NewBaseService ( logger , " " , r ) for _ , opt := range options { opt ( r ) } return r }
NewReactor returns a reference to a new consensus reactor, which implements
the service.Service interface.
NewReactor returns a reference to a new consensus reactor which implements the service . Service interface .