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 {
maxConfirmedTd: big.NewInt(0),
}
pm.peers.notify(f)
f.pm.wg.Add(1)
go f.syncLoop()
return f
}
// syncLoop is the main event loop of the light fetcher
func (f *lightFetcher) syncLoop() {
f.pm.wg.Add(1)
defer f.pm.wg.Done()
requesting := false
defer f.pm.wg.Done()
for {
select {
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