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 kyrie-yl committed Nov 18, 2022
1 parent dbc70ee commit b8c2d2e
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 b8c2d2e

Please sign in to comment.