mirror of
https://github.com/matrix-org/pinecone.git
synced 2026-10-24 11:59:18 +03:00
Reinstate mutex
This commit is contained in:
@@ -220,9 +220,9 @@ func (t *virtualSnake) getVirtualSnakeNextHop(from *Peer, destKey types.PublicKe
|
||||
// Finally, look at our direct peers, in case of any of our direct
|
||||
// peers end up being a better path than anything else we've come up
|
||||
// with so far.
|
||||
//peer.mutex.RLock()
|
||||
peer.mutex.RLock()
|
||||
peerKey := peer.public
|
||||
//peer.mutex.RUnlock()
|
||||
peer.mutex.RUnlock()
|
||||
switch {
|
||||
case !bootstrap && peerKey.EqualTo(destKey):
|
||||
newCandidate(peerKey, peer.port)
|
||||
@@ -233,9 +233,9 @@ func (t *virtualSnake) getVirtualSnakeNextHop(from *Peer, destKey types.PublicKe
|
||||
if bootstrap {
|
||||
return types.SwitchPorts{bestPort}
|
||||
} else if PortCount-canlength == 0 {
|
||||
return types.SwitchPorts{0} // TODO: EXPERIMENTAL! Remove this!
|
||||
return types.SwitchPorts{0} // TODO: Experimental - remove soon.
|
||||
} else {
|
||||
return types.SwitchPorts{bestPort} // candidates[canlength:]
|
||||
return candidates[canlength:]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user