fix addrbook start/stop

This commit is contained in:
Ethan Buchman
2017-03-05 22:59:18 -05:00
parent c94bc2bc2b
commit beb3eda438
2 changed files with 5 additions and 2 deletions

View File

@ -135,6 +135,9 @@ func (a *AddrBook) OnStart() error {
func (a *AddrBook) OnStop() {
a.BaseService.OnStop()
}
func (a *AddrBook) Wait() {
a.wg.Wait()
}

View File

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