Skip to content

Commit 2003b79

Browse files
authored
Merge pull request #16095 from karalabe/les-lock
les: add missing lock around peer access
2 parents e2f2bb3 + dfc5842 commit 2003b79

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎les/fetcher.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ func (f *lightFetcher) nextRequest() (*distReq, uint64) {
425425
},
426426
canSend: func(dp distPeer) bool {
427427
p := dp.(*peer)
428+
f.lock.Lock()
429+
defer f.lock.Unlock()
430+
428431
fp := f.peers[p]
429432
return fp != nil && fp.nodeByHash[bestHash] != nil
430433
},

0 commit comments

Comments
 (0)