Unverified Commit 656dc8cc authored by Justin Traglia's avatar Justin Traglia Committed by GitHub

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

Unlock peerSet if there's an error in the downloader
parent 32e84906
...@@ -237,6 +237,7 @@ func (ps *peerSet) Register(p *peerConnection) error { ...@@ -237,6 +237,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
} }
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip()) p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
if err := ps.rates.Track(p.id, p.rates); err != nil { if err := ps.rates.Track(p.id, p.rates); err != nil {
ps.lock.Unlock()
return err return err
} }
ps.peers[p.id] = p ps.peers[p.id] = p
......
...@@ -350,6 +350,7 @@ func (ps *peerSet) Register(p *peerConnection) error { ...@@ -350,6 +350,7 @@ func (ps *peerSet) Register(p *peerConnection) error {
} }
p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip()) p.rates = msgrate.NewTracker(ps.rates.MeanCapacities(), ps.rates.MedianRoundTrip())
if err := ps.rates.Track(p.id, p.rates); err != nil { if err := ps.rates.Track(p.id, p.rates); err != nil {
ps.lock.Unlock()
return err return err
} }
ps.peers[p.id] = p ps.peers[p.id] = p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment