From e7cc5b41605f9145b2cb5755476456f30974a2c8 Mon Sep 17 00:00:00 2001 From: cpusoft Date: Wed, 11 Apr 2018 16:02:33 +0800 Subject: [PATCH] les: add ps.lock.Unlock() before return (#16360) --- les/peer.go | 2 ++ 1 file changed, 2 insertions(+) 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