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

Co-authored-by: linjing <linjingjing@baidu.com>
pull/21228/head
sixdays 4 years ago committed by GitHub
parent 9371b2f70c
commit a981b60c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      eth/downloader/peer.go

@ -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…
Cancel
Save