Cleanup - maybe working...
This commit is contained in:
@@ -27,12 +27,12 @@ func (a *App) onTick() {
|
||||
a.sendPing(p, now)
|
||||
}
|
||||
|
||||
switch p.State() {
|
||||
switch p.State {
|
||||
case StateProbing:
|
||||
// Promote probing peers to direct once alive (direct path confirmed
|
||||
// working).
|
||||
if time.Since(p.LastHandshakeTime()) < wginterface.SessionTimeout {
|
||||
a.devAddDirect(p, p.WGEndpoint())
|
||||
if time.Since(p.LastHandshakeTime()) < 2*wginterface.ProbeKeepalive {
|
||||
a.devPromote(p)
|
||||
}
|
||||
|
||||
case StateDirect:
|
||||
@@ -43,8 +43,8 @@ func (a *App) onTick() {
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure we have a live relay.
|
||||
if a.relay == nil || !a.relay.Up() {
|
||||
// Ensure we have a live relay (if we're not public).
|
||||
if !a.isPublic && (a.relay == nil || !a.relay.Up()) {
|
||||
a.switchActiveRelay()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user