From c1f8baf9b5f6ecff858374b74f70a49047ae6bd8 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Thu, 7 Jun 2018 14:39:43 -0500 Subject: [PATCH] update dht.reset() to possibly play better with coord changes --- src/yggdrasil/dht.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/dht.go b/src/yggdrasil/dht.go index 3c9f61c9..e77ab90d 100644 --- a/src/yggdrasil/dht.go +++ b/src/yggdrasil/dht.go @@ -520,9 +520,15 @@ func dht_firstCloserThanThird(first *NodeID, func (t *dht) reset() { // 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 { 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] } - t.offset = 0 }