diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-02-15 19:02:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 19:02:36 +0800 |
commit | 2003b797794aee2709662c8fa085b34835ec0241 (patch) | |
tree | 55cf3b4f103ebbf4df017efa2e7f231dbe531748 | |
parent | e2f2bb3e2e57118a3c206be91554c67cc9b2622b (diff) | |
parent | dfc5842a89781c22e847913f723d6b0a4e439479 (diff) | |
download | dexon-2003b797794aee2709662c8fa085b34835ec0241.tar dexon-2003b797794aee2709662c8fa085b34835ec0241.tar.gz dexon-2003b797794aee2709662c8fa085b34835ec0241.tar.bz2 dexon-2003b797794aee2709662c8fa085b34835ec0241.tar.lz dexon-2003b797794aee2709662c8fa085b34835ec0241.tar.xz dexon-2003b797794aee2709662c8fa085b34835ec0241.tar.zst dexon-2003b797794aee2709662c8fa085b34835ec0241.zip |
Merge pull request #16095 from karalabe/les-lock
les: add missing lock around peer access
-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 }, |