From fe5ef4e867cc9d0729150e462def3ec78a64c3b9 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 17 Mar 2018 15:28:22 -0500 Subject: [PATCH] don't add things to the dht rumorMill if they've been pinged in the last minute (arbitrary time, needs investigating) --- src/yggdrasil/dht.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/yggdrasil/dht.go b/src/yggdrasil/dht.go index f7226624..ec4e33f3 100644 --- a/src/yggdrasil/dht.go +++ b/src/yggdrasil/dht.go @@ -451,7 +451,7 @@ func (t *dht) doMaintenance() { } } } - if oldest != nil { + if oldest != nil && time.Since(oldest.recv) > time.Minute { t.addToMill(oldest, nil) } // if the DHT isn't empty // Refresh buckets @@ -460,8 +460,10 @@ func (t *dht) doMaintenance() { } target := t.getTarget(t.offset) for _, info := range t.lookup(target) { - t.addToMill(info, target) - break + if time.Since(info.recv) > time.Minute { + t.addToMill(info, target) + break + } } t.offset++ }