Unverified Commit a981b60c authored by sixdays's avatar sixdays Committed by GitHub

eth/downloader: don't use defer for unlock before return (#21227)

Co-authored-by: 's avatarlinjing <linjingjing@baidu.com>
parent 9371b2f7
...@@ -421,7 +421,7 @@ func (ps *peerSet) Unregister(id string) error { ...@@ -421,7 +421,7 @@ func (ps *peerSet) Unregister(id string) error {
ps.lock.Lock() ps.lock.Lock()
p, ok := ps.peers[id] p, ok := ps.peers[id]
if !ok { if !ok {
defer ps.lock.Unlock() ps.lock.Unlock()
return errNotRegistered return errNotRegistered
} }
delete(ps.peers, id) delete(ps.peers, id)
......
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