From 605b6a6a098ba4b158881572f08a29a88c3a09a9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Mar 2024 17:48:27 -0400 Subject: [PATCH] fix: add lock to GetChallenge --- net/ws.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ws.go b/net/ws.go index cc5b10a..695ab25 100644 --- a/net/ws.go +++ b/net/ws.go @@ -142,6 +142,8 @@ func (p *WebSocketPeer) SetChallenge(challenge []byte) { } func (p *WebSocketPeer) GetChallenge() []byte { + p.BasePeer.lock.RLock() + defer p.BasePeer.lock.RUnlock() return p.challenge }