Skip to content

Commit 7412339

Browse files
jtragliajagdeep sidhu
authored and
jagdeep sidhu
committedAug 21, 2022
eth, les: unlock downloader peerSet if there's an error (ethereum#25546)
Unlock peerSet if there's an error in the downloader
1 parent 0d1ea6a commit 7412339

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
 

‎eth/downloader/peer.go

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
246246
}
247247
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
248248
if err := ps.rates.Track(p.id, p.rates); err != nil {
249+
ps.lock.Unlock()
249250
return err
250251
}
251252
ps.peers[p.id] = p

‎les/downloader/peer.go

+1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
359359
}
360360
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
361361
if err := ps.rates.Track(p.id, p.rates); err != nil {
362+
ps.lock.Unlock()
362363
return err
363364
}
364365
ps.peers[p.id] = p

0 commit comments

Comments
 (0)
Please sign in to comment.