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 firmianavan committed Aug 28, 2018
1 parent 50fad59 commit 8dac657
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 8dac657

Please sign in to comment.