mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-10 07:20:39 +03:00
update dht.reset() to possibly play better with coord changes
This commit is contained in:
parent
d468882147
commit
c1f8baf9b5
@ -520,9 +520,15 @@ func dht_firstCloserThanThird(first *NodeID,
|
|||||||
|
|
||||||
func (t *dht) reset() {
|
func (t *dht) reset() {
|
||||||
// This is mostly so bootstrapping will reset to resend coords into the network
|
// This is mostly so bootstrapping will reset to resend coords into the network
|
||||||
|
t.offset = 0
|
||||||
|
t.rumorMill = nil // reset mill
|
||||||
for _, b := range t.buckets_hidden {
|
for _, b := range t.buckets_hidden {
|
||||||
b.peers = b.peers[:0]
|
b.peers = b.peers[:0]
|
||||||
|
for _, info := range b.other {
|
||||||
|
// Add other nodes to the rumor mill so they'll be pinged soon
|
||||||
|
// This will hopefully tell them our coords and re-learn theirs quickly if they haven't changed
|
||||||
|
t.addToMill(info, info.getNodeID())
|
||||||
|
}
|
||||||
b.other = b.other[:0]
|
b.other = b.other[:0]
|
||||||
}
|
}
|
||||||
t.offset = 0
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user