diff --git a/internal/peermanager/peermanager.go b/internal/peermanager/peermanager.go index 00857627..1d4538a7 100644 --- a/internal/peermanager/peermanager.go +++ b/internal/peermanager/peermanager.go @@ -231,6 +231,9 @@ func (pm *PeerManager) UnregisterSession(ses uint64) { // signalAvailability is called when a peer's connectivity changes. // It informs interested sessions. func (pm *PeerManager) signalAvailability(p peer.ID, isConnected bool) { + pm.psLk.Lock() + defer pm.psLk.Unlock() + sesIds, ok := pm.peerSessions[p] if !ok { return