Skip to content

Commit a981b60

Browse files
authored
eth/downloader: don't use defer for unlock before return (#21227)
Co-authored-by: linjing <linjingjing@baidu.com>
1 parent 9371b2f commit a981b60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎eth/downloader/peer.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (ps *peerSet) Unregister(id string) error {
421421
ps.lock.Lock()
422422
p, ok := ps.peers[id]
423423
if !ok {
424-
defer ps.lock.Unlock()
424+
ps.lock.Unlock()
425425
return errNotRegistered
426426
}
427427
delete(ps.peers, id)

0 commit comments

Comments
 (0)