Unverified Commit 06129d6f authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #417 from ipfs/fix/peermgr-race

Fix PeerManager signalAvailabiity() race
parents 25318da3 980ca8d4
...@@ -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