5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-25 23:01:38 +00:00

fix infinite loop from interaction between dht.isImportant and dht.insert

This commit is contained in:
Arceliar 2018-11-25 20:33:33 -06:00
parent 0ec6207e05
commit d8d1e63c36

View File

@ -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()