Commit 980ca8d4 authored by Dirk McCormick's avatar Dirk McCormick

fix: PeerManager signalAvailabiity() race

parent 25318da3
...@@ -231,6 +231,9 @@ func (pm *PeerManager) UnregisterSession(ses uint64) { ...@@ -231,6 +231,9 @@ func (pm *PeerManager) UnregisterSession(ses uint64) {
// signalAvailability is called when a peer's connectivity changes. // signalAvailability is called when a peer's connectivity changes.
// It informs interested sessions. // It informs interested sessions.
func (pm *PeerManager) signalAvailability(p peer.ID, isConnected bool) { func (pm *PeerManager) signalAvailability(p peer.ID, isConnected bool) {
pm.psLk.Lock()
defer pm.psLk.Unlock()
sesIds, ok := pm.peerSessions[p] sesIds, ok := pm.peerSessions[p]
if !ok { if !ok {
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment