mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	fix infinite loop from interaction between dht.isImportant and dht.insert
This commit is contained in:
		
							parent
							
								
									0ec6207e05
								
							
						
					
					
						commit
						d8d1e63c36
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue