1
0
mirror of https://github.com/matrix-org/pinecone.git synced 2026-10-24 11:59:18 +03:00

Fix pineconeip

This commit is contained in:
Neil Alexander
2021-05-12 14:57:44 +01:00
parent 8fe3e14cdd
commit 5b4be7a27a
2 changed files with 7 additions and 4 deletions

View File

@@ -290,6 +290,9 @@ func (t *virtualSnake) getVirtualSnakeNextHop(from *Peer, destKey types.PublicKe
newCandidate(peerKey, peer.port)
}
}
if canlength-PortCount == 0 {
return types.SwitchPorts{0}
}
return candidates[canlength:]
}

View File

@@ -34,7 +34,7 @@ const announcementThreshold = announcementInterval / 2
// announcementInterval is the frequency at which this
// node will send root announcements to other peers.
const announcementInterval = time.Second * 15
const announcementInterval = time.Second * 24
// announcementTimeout is the amount of time that must
// pass without receiving a root announcement before we
@@ -365,10 +365,10 @@ func (t *spanningTree) Update(p *Peer, a *types.SwitchAnnouncement) error {
t.rootMutex.Lock()
t.root = newRoot
t.rootMutex.Unlock()
}
if p.port == t.updateCoordinates() {
t.advertise.Dispatch()
}
if p.port == t.updateCoordinates() {
t.advertise.Dispatch()
}
return nil