start/stop the book with reactor

Refs https://github.com/tendermint/tendermint/issues/335
This commit is contained in:
Anton Kalyaev 2017-01-13 19:33:31 +04:00 committed by Ethan Buchman
parent 17e6ae813f
commit 332f7056f7
1 changed files with 2 additions and 0 deletions

View File

@ -42,12 +42,14 @@ func NewPEXReactor(book *AddrBook) *PEXReactor {
func (pexR *PEXReactor) OnStart() error {
pexR.BaseReactor.OnStart()
pexR.book.OnStart()
go pexR.ensurePeersRoutine()
return nil
}
func (pexR *PEXReactor) OnStop() {
pexR.BaseReactor.OnStop()
pexR.book.OnStop()
}
// Implements Reactor