Skip to content

Commit dfc5842

Browse files
committed
les: add missing lock around peer access
1 parent ff225db commit dfc5842

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)