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 {
ps.lock.Lock()
p, ok := ps.peers[id]
if !ok {
defer ps.lock.Unlock()
ps.lock.Unlock()
return errNotRegistered
}
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