Skip to content

Commit

Permalink
les: add ps.lock.Unlock() before return (ethereum#16360)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpusoft authored and mariameda committed Aug 19, 2018
1 parent d90f879 commit bb958d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions les/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,11 @@ func (ps *peerSet) notify(n peerSetNotify) {
func (ps *peerSet) Register(p *peer) error {
ps.lock.Lock()
if ps.closed {
ps.lock.Unlock()
return errClosed
}
if _, ok := ps.peers[p.id]; ok {
ps.lock.Unlock()
return errAlreadyRegistered
}
ps.peers[p.id] = p
Expand Down

0 comments on commit bb958d1

Please sign in to comment.