diff options
-rw-r--r-- | les/peer.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/les/peer.go b/les/peer.go index caf568077..eb7452e27 100644 --- a/les/peer.go +++ b/les/peer.go @@ -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 |