mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-23 20:07:16 +00:00
les: fix misuse of WaitGroup (#15365)
This commit is contained in:
parent
9619a61024
commit
0914d4e0d2
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user