Simplify Service/Reactor pattern

This commit is contained in:
Jae Kwon
2015-07-21 18:31:01 -07:00
parent 7441e322d0
commit e7c1febb65
14 changed files with 67 additions and 56 deletions

View File

@@ -76,14 +76,16 @@ func NewBlockchainReactor(state *sm.State, store *BlockStore, sync bool) *Blockc
return bcR
}
func (bcR *BlockchainReactor) AfterStart() {
func (bcR *BlockchainReactor) OnStart() {
bcR.BaseReactor.OnStart()
if bcR.sync {
bcR.pool.Start()
go bcR.poolRoutine()
}
}
func (bcR *BlockchainReactor) AfterStop() {
func (bcR *BlockchainReactor) OnStop() {
bcR.BaseReactor.OnStop()
bcR.pool.Stop()
}