From dfc5842a89781c22e847913f723d6b0a4e439479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 14 Feb 2018 21:09:20 +0200 Subject: [PATCH] les: add missing lock around peer access --- les/fetcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/les/fetcher.go b/les/fetcher.go index 3fc4df30b..9d224176f 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -425,6 +425,9 @@ func (f *lightFetcher) nextRequest() (*distReq, uint64) { }, canSend: func(dp distPeer) bool { p := dp.(*peer) + f.lock.Lock() + defer f.lock.Unlock() + fp := f.peers[p] return fp != nil && fp.nodeByHash[bestHash] != nil },