diff options
author | Evgeny Danilenko <6655321@bk.ru> | 2017-11-09 17:34:35 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-11-09 17:34:35 +0800 |
commit | 0914d4e0d2b29249bdec9d2342256c39e1787bf3 (patch) | |
tree | d04636b0cadf2a331ab520c3a1bcea4f420f7263 /les/fetcher.go | |
parent | 9619a610248e9630968ba1d9be8e214b645c9c55 (diff) | |
download | dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.gz dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.bz2 dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.lz dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.xz dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.zst dexon-0914d4e0d2b29249bdec9d2342256c39e1787bf3.zip |
les: fix misuse of WaitGroup (#15365)
Diffstat (limited to 'les/fetcher.go')
-rw-r--r-- | les/fetcher.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/les/fetcher.go b/les/fetcher.go index 4fc142f0f..3fc4df30b 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -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: |