mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-25 23:01:38 +00:00
remove any peers from the dht if a reset is triggered (from coord changes)
This commit is contained in:
parent
9ce0b7fbea
commit
b34345229a
@ -485,3 +485,9 @@ func dht_firstCloserThanThird(first *NodeID,
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *dht) resetPeers() {
|
||||||
|
for _, b := range t.buckets_hidden {
|
||||||
|
b.peers = b.peers[:0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -80,6 +80,7 @@ func (r *router) mainLoop() {
|
|||||||
r.core.dht.insertIfNew(info, true)
|
r.core.dht.insertIfNew(info, true)
|
||||||
case <-r.reset:
|
case <-r.reset:
|
||||||
r.core.sessions.resetInits()
|
r.core.sessions.resetInits()
|
||||||
|
r.core.dht.resetPeers()
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
{
|
{
|
||||||
// Any periodic maintenance stuff goes here
|
// Any periodic maintenance stuff goes here
|
||||||
|
Loading…
Reference in New Issue
Block a user