mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-01-12 11:03:44 +00:00
remove peers completely after a long switch timeout, this could use some improvement later
This commit is contained in:
parent
ebbe5f67ad
commit
5ddf84f329
@ -281,6 +281,7 @@ func (t *switchTable) cleanPeers() {
|
|||||||
if now.Sub(peer.time) > switch_timeout+switch_throttle {
|
if now.Sub(peer.time) > switch_timeout+switch_throttle {
|
||||||
// Longer than switch_timeout to make sure we don't remove a working peer because the root stopped responding.
|
// Longer than switch_timeout to make sure we don't remove a working peer because the root stopped responding.
|
||||||
delete(t.data.peers, port)
|
delete(t.data.peers, port)
|
||||||
|
go t.core.peers.removePeer(port) // TODO figure out if it's safe to do this without a goroutine, or make it safe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, isIn := t.data.peers[t.parent]; !isIn {
|
if _, isIn := t.data.peers[t.parent]; !isIn {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user