Skip to content

Commit

Permalink
eth, les: unlock downloader peerSet if there's an error (ethereum#25546)
Browse files Browse the repository at this point in the history
Unlock peerSet if there's an error in the downloader
  • Loading branch information
jtraglia authored and blakehhuynh committed Oct 3, 2022
1 parent 45296b8 commit 1c95ed3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions eth/downloader/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
}
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
if err := ps.rates.Track(p.id, p.rates); err != nil {
ps.lock.Unlock()
return err
}
ps.peers[p.id] = p
Expand Down
1 change: 1 addition & 0 deletions les/downloader/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
}
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
if err := ps.rates.Track(p.id, p.rates); err != nil {
ps.lock.Unlock()
return err
}
ps.peers[p.id] = p
Expand Down

0 comments on commit 1c95ed3

Please sign in to comment.