fix: use Lock

This commit is contained in:
Derrick Hammer 2024-03-11 17:47:56 -04:00
parent 1ecbda1a54
commit 7173abb54f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ func (p *WebSocketPeer) EndForAbuse() error {
return nil return nil
} }
func (p *WebSocketPeer) SetId(id *encoding.NodeId) { func (p *WebSocketPeer) SetId(id *encoding.NodeId) {
p.BasePeer.lock.RLock() p.BasePeer.lock.Lock()
defer p.BasePeer.lock.Unlock() defer p.BasePeer.lock.Unlock()
p.id = id p.id = id
} }