Browse Source

Removed unnecessary onStart call (#2098)

* Removed unnecessary onStart & onStop calls in reactor

* Refactor OnStart & OnStop in reactor

* Removed redundant OnStart func in reactor
pull/2105/head
VenkatDatta 6 years ago
committed by Anton Kaliaev
parent
commit
188e459273
4 changed files with 0 additions and 17 deletions
  1. +0
    -4
      blockchain/reactor.go
  2. +0
    -4
      consensus/reactor.go
  3. +0
    -5
      evidence/reactor.go
  4. +0
    -4
      p2p/pex/pex_reactor.go

+ 0
- 4
blockchain/reactor.go View File

@ -109,9 +109,6 @@ func (bcR *BlockchainReactor) SetLogger(l log.Logger) {
// OnStart implements cmn.Service.
func (bcR *BlockchainReactor) OnStart() error {
if err := bcR.BaseReactor.OnStart(); err != nil {
return err
}
if bcR.fastSync {
err := bcR.pool.Start()
if err != nil {
@ -124,7 +121,6 @@ func (bcR *BlockchainReactor) OnStart() error {
// OnStop implements cmn.Service.
func (bcR *BlockchainReactor) OnStop() {
bcR.BaseReactor.OnStop()
bcR.pool.Stop()
}


+ 0
- 4
consensus/reactor.go View File

@ -58,9 +58,6 @@ func NewConsensusReactor(consensusState *ConsensusState, fastSync bool) *Consens
// broadcasted to other peers and starting state if we're not in fast sync.
func (conR *ConsensusReactor) OnStart() error {
conR.Logger.Info("ConsensusReactor ", "fastSync", conR.FastSync())
if err := conR.BaseReactor.OnStart(); err != nil {
return err
}
conR.subscribeToBroadcastEvents()
@ -77,7 +74,6 @@ func (conR *ConsensusReactor) OnStart() error {
// OnStop implements BaseService by unsubscribing from events and stopping
// state.
func (conR *ConsensusReactor) OnStop() {
conR.BaseReactor.OnStop()
conR.unsubscribeFromBroadcastEvents()
conR.conS.Stop()
if !conR.FastSync() {


+ 0
- 5
evidence/reactor.go View File

@ -44,11 +44,6 @@ func (evR *EvidenceReactor) SetLogger(l log.Logger) {
evR.evpool.SetLogger(l)
}
// OnStart implements cmn.Service
func (evR *EvidenceReactor) OnStart() error {
return evR.BaseReactor.OnStart()
}
// GetChannels implements Reactor.
// It returns the list of channels for this reactor.
func (evR *EvidenceReactor) GetChannels() []*p2p.ChannelDescriptor {


+ 0
- 4
p2p/pex/pex_reactor.go View File

@ -113,9 +113,6 @@ func NewPEXReactor(b AddrBook, config *PEXReactorConfig) *PEXReactor {
// OnStart implements BaseService
func (r *PEXReactor) OnStart() error {
if err := r.BaseReactor.OnStart(); err != nil {
return err
}
err := r.book.Start()
if err != nil && err != cmn.ErrAlreadyStarted {
return err
@ -139,7 +136,6 @@ func (r *PEXReactor) OnStart() error {
// OnStop implements BaseService
func (r *PEXReactor) OnStop() {
r.BaseReactor.OnStop()
r.book.Stop()
}


Loading…
Cancel
Save