From d8d1e63c36735ac8eb097aa43e31c69c347beb12 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 25 Nov 2018 20:33:33 -0600 Subject: [PATCH] fix infinite loop from interaction between dht.isImportant and dht.insert --- src/yggdrasil/dht.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yggdrasil/dht.go b/src/yggdrasil/dht.go index 6e08ad2..aa694f7 100644 --- a/src/yggdrasil/dht.go +++ b/src/yggdrasil/dht.go @@ -361,6 +361,9 @@ func (t *dht) getImportant() []*dhtInfo { // Returns true if this is a node we need to keep track of for the DHT to work. func (t *dht) isImportant(ninfo *dhtInfo) bool { + if ninfo.key == t.core.boxPub { + return false + } important := t.getImportant() // Check if ninfo is of equal or greater importance to what we already know loc := t.core.switchTable.getLocator()