Merge pull request #16095 from karalabe/les-lock

les: add missing lock around peer access
pull/16102/head
Péter Szilágyi 7 years ago committed by GitHub
commit 2003b79779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      les/fetcher.go

@ -425,6 +425,9 @@ func (f *lightFetcher) nextRequest() (*distReq, uint64) {
}, },
canSend: func(dp distPeer) bool { canSend: func(dp distPeer) bool {
p := dp.(*peer) p := dp.(*peer)
f.lock.Lock()
defer f.lock.Unlock()
fp := f.peers[p] fp := f.peers[p]
return fp != nil && fp.nodeByHash[bestHash] != nil return fp != nil && fp.nodeByHash[bestHash] != nil
}, },

Loading…
Cancel
Save