mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-01 17:13:45 +00:00
les: add ps.lock.Unlock() before return (#16360)
This commit is contained in:
parent
34ecb495b6
commit
e7cc5b4160
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue