aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Danilenko <6655321@bk.ru>2017-11-09 17:34:35 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-11-09 17:34:35 +0800
commit0914d4e0d2b29249bdec9d2342256c39e1787bf3 (patch)
treed04636b0cadf2a331ab520c3a1bcea4f420f7263
parent9619a610248e9630968ba1d9be8e214b645c9c55 (diff)
downloadgo-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.gz
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.bz2
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.lz
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.xz
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.tar.zst
go-tangerine-0914d4e0d2b29249bdec9d2342256c39e1787bf3.zip
les: fix misuse of WaitGroup (#15365)
-rw-r--r--les/fetcher.go6
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: