aboutsummaryrefslogtreecommitdiffstats
path: root/les/peer.go
diff options
context:
space:
mode:
authorcpusoft <cpusoft@live.com>2018-04-11 16:02:33 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-04-11 16:02:33 +0800
commite7cc5b41605f9145b2cb5755476456f30974a2c8 (patch)
tree24ee2518ed9935afeb3451680ab0f2dc0e7e3695 /les/peer.go
parent34ecb495b673b9ce35af20ccb5b44cd175003b94 (diff)
downloaddexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar.gz
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar.bz2
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar.lz
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar.xz
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.tar.zst
dexon-e7cc5b41605f9145b2cb5755476456f30974a2c8.zip
les: add ps.lock.Unlock() before return (#16360)
Diffstat (limited to 'les/peer.go')
-rw-r--r--les/peer.go2
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