Skip to content

Commit e7cc5b4

Browse files
cpusoftkaralabe
authored andcommitted
les: add ps.lock.Unlock() before return (#16360)
1 parent 34ecb49 commit e7cc5b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

les/peer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,11 @@ func (ps *peerSet) notify(n peerSetNotify) {
545545
func (ps *peerSet) Register(p *peer) error {
546546
ps.lock.Lock()
547547
if ps.closed {
548+
ps.lock.Unlock()
548549
return errClosed
549550
}
550551
if _, ok := ps.peers[p.id]; ok {
552+
ps.lock.Unlock()
551553
return errAlreadyRegistered
552554
}
553555
ps.peers[p.id] = p

0 commit comments

Comments
 (0)