eth/downloader: don't use defer for unlock before return (#21227)
Co-authored-by: linjing <linjingjing@baidu.com>
This commit is contained in:
parent
9371b2f70c
commit
a981b60c25
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue