diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-02-15 03:09:20 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-02-15 03:09:20 +0800 |
commit | dfc5842a89781c22e847913f723d6b0a4e439479 (patch) | |
tree | 57c1dca59fe65666e5353396211645ba48de86fd /les/fetcher.go | |
parent | ff225db813b6d56ecd35db301bc582ca04e42b27 (diff) | |
download | dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar.gz dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar.bz2 dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar.lz dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar.xz dexon-dfc5842a89781c22e847913f723d6b0a4e439479.tar.zst dexon-dfc5842a89781c22e847913f723d6b0a4e439479.zip |
les: add missing lock around peer access
Diffstat (limited to 'les/fetcher.go')
-rw-r--r-- | les/fetcher.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 }, |