Skip to content

Commit

Permalink
les: fix misuse of WaitGroup (ethereum#15365)
Browse files Browse the repository at this point in the history
  • Loading branch information
JekaMas authored and fjl committed Nov 9, 2017
1 parent 9619a61 commit 0914d4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions les/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0914d4e

Please sign in to comment.