Cleanup
This commit is contained in:
@@ -36,12 +36,12 @@ func (a *App) onTick() {
|
||||
}
|
||||
|
||||
case StateDirect:
|
||||
// Demote stale non-public direct peers back to probing.
|
||||
// Public nodes skip this: the non-public peer will re-initiate the
|
||||
// handshake, and WireGuard will update the endpoint automatically.
|
||||
if !p.IsPublic && !p.Up() && !a.isPublic {
|
||||
a.devAddProbe(p, p.WGEndpoint())
|
||||
if p.IsPublic || a.isPublic || p.Up() {
|
||||
break
|
||||
}
|
||||
// Stale non-public direct peer: demote to probing so WireGuard
|
||||
// resumes handshake attempts on the direct path.
|
||||
a.devAddProbe(p, p.WGEndpoint())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user