- remove direct field from status

- add randomisation factor for reconnection
- fix rosenpass status
This commit is contained in:
Zoltán Papp
2024-07-17 16:26:41 +02:00
parent 03e8acccde
commit 7162e0a2ac
8 changed files with 218 additions and 241 deletions

View File

@@ -20,7 +20,6 @@ import (
type routerPeerStatus struct {
connected bool
relayed bool
direct bool
latency time.Duration
}
@@ -80,7 +79,6 @@ func (c *clientNetwork) getRouterPeerStatuses() map[route.ID]routerPeerStatus {
routePeerStatuses[r.ID] = routerPeerStatus{
connected: peerStatus.ConnStatus == peer.StatusConnected,
relayed: peerStatus.Relayed,
direct: peerStatus.Direct,
latency: peerStatus.Latency,
}
}
@@ -135,10 +133,6 @@ func (c *clientNetwork) getBestRouteFromStatuses(routePeerStatuses map[route.ID]
tempScore++
}
if peerStatus.direct {
tempScore++
}
if tempScore > chosenScore || (tempScore == chosenScore && chosen == "") {
chosen = r.ID
chosenScore = tempScore