mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-15 07:26:05 +00:00
fix infinite loop from interaction between dht.isImportant and dht.insert
This commit is contained in:
@ -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.
|
// 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 {
|
func (t *dht) isImportant(ninfo *dhtInfo) bool {
|
||||||
|
if ninfo.key == t.core.boxPub {
|
||||||
|
return false
|
||||||
|
}
|
||||||
important := t.getImportant()
|
important := t.getImportant()
|
||||||
// Check if ninfo is of equal or greater importance to what we already know
|
// Check if ninfo is of equal or greater importance to what we already know
|
||||||
loc := t.core.switchTable.getLocator()
|
loc := t.core.switchTable.getLocator()
|
||||||
|
Reference in New Issue
Block a user