This commit is contained in:
Anton Kaliaev 2017-04-17 13:22:59 +04:00
parent 4c0d1d3ad2
commit 5ab8ca0868
No known key found for this signature in database
GPG Key ID: 7B6881D965918214

View File

@ -135,15 +135,15 @@ func (a *AddrBook) OnStart() error {
return nil
}
func (a *AddrBook) Wait() {
a.wg.Wait()
}
// OnStop implements Service.
func (a *AddrBook) OnStop() {
a.BaseService.OnStop()
}
func (a *AddrBook) Wait() {
a.wg.Wait()
}
func (a *AddrBook) AddOurAddress(addr *NetAddress) {
a.mtx.Lock()
defer a.mtx.Unlock()
@ -320,6 +320,8 @@ type addrBookJSON struct {
func (a *AddrBook) saveToFile(filePath string) {
log.Info("Saving AddrBook to file", "size", a.Size())
a.mtx.Lock()
defer a.mtx.Unlock()
// Compile Addrs
addrs := []*knownAddress{}
for _, ka := range a.addrLookup {