Browse Source

fix addrbook start/stop

pull/456/head
Ethan Buchman 8 years ago
parent
commit
beb3eda438
2 changed files with 5 additions and 2 deletions
  1. +3
    -0
      addrbook.go
  2. +2
    -2
      pex_reactor.go

+ 3
- 0
addrbook.go View File

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


+ 2
- 2
pex_reactor.go View File

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


Loading…
Cancel
Save