Commit 0914d4e0 authored by Evgeny Danilenko's avatar Evgeny Danilenko Committed by Felix Lange

les: fix misuse of WaitGroup (#15365)

parent 9619a610
...@@ -117,16 +117,16 @@ func newLightFetcher(pm *ProtocolManager) *lightFetcher { ...@@ -117,16 +117,16 @@ func newLightFetcher(pm *ProtocolManager) *lightFetcher {
maxConfirmedTd: big.NewInt(0), maxConfirmedTd: big.NewInt(0),
} }
pm.peers.notify(f) pm.peers.notify(f)
f.pm.wg.Add(1)
go f.syncLoop() go f.syncLoop()
return f return f
} }
// syncLoop is the main event loop of the light fetcher // syncLoop is the main event loop of the light fetcher
func (f *lightFetcher) syncLoop() { func (f *lightFetcher) syncLoop() {
f.pm.wg.Add(1)
defer f.pm.wg.Done()
requesting := false requesting := false
defer f.pm.wg.Done()
for { for {
select { select {
case <-f.pm.quitSync: case <-f.pm.quitSync:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment