QuitService->BaseService

This commit is contained in:
Jae Kwon
2016-10-28 12:03:21 -07:00
committed by Ethan Buchman
parent eab2baa363
commit bd353e004a
2 changed files with 6 additions and 6 deletions

View File

@ -75,7 +75,7 @@ const (
/* AddrBook - concurrency safe peer address manager */
type AddrBook struct {
QuitService
BaseService
mtx sync.Mutex
filePath string
@ -106,7 +106,7 @@ func NewAddrBook(filePath string, routabilityStrict bool) *AddrBook {
routabilityStrict: routabilityStrict,
}
am.init()
am.QuitService = *NewQuitService(log, "AddrBook", am)
am.BaseService = *NewBaseService(log, "AddrBook", am)
return am
}
@ -126,7 +126,7 @@ func (a *AddrBook) init() {
}
func (a *AddrBook) OnStart() error {
a.QuitService.OnStart()
a.BaseService.OnStart()
a.loadFromFile(a.filePath)
a.wg.Add(1)
go a.saveRoutine()
@ -134,7 +134,7 @@ func (a *AddrBook) OnStart() error {
}
func (a *AddrBook) OnStop() {
a.QuitService.OnStop()
a.BaseService.OnStop()
a.wg.Wait()
}