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() {
a.BaseService.OnStop()
}
func (a *AddrBook) 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 {
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


Loading…
Cancel
Save