eth, les: unlock downloader peerSet if there's an error (#25546)

Unlock peerSet if there's an error in the downloader
pull/25555/head
Justin Traglia 2 years ago committed by GitHub
parent 32e8490615
commit 656dc8cc00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      eth/downloader/peer.go
  2. 1
      les/downloader/peer.go

@ -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

@ -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

Loading…
Cancel
Save