Skip to content

Commit 656dc8c

Browse files
authored
eth, les: unlock downloader peerSet if there's an error (#25546)
Unlock peerSet if there's an error in the downloader
1 parent 32e8490 commit 656dc8c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

eth/downloader/peer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
237237
}
238238
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
239239
if err := ps.rates.Track(p.id, p.rates); err != nil {
240+
ps.lock.Unlock()
240241
return err
241242
}
242243
ps.peers[p.id] = p

les/downloader/peer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
350350
}
351351
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
352352
if err := ps.rates.Track(p.id, p.rates); err != nil {
353+
ps.lock.Unlock()
353354
return err
354355
}
355356
ps.peers[p.id] = p

0 commit comments

Comments
 (0)