mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	don't store every node we hear from in the DHT, only ones we already know about or that are important
This commit is contained in:
		
							parent
							
								
									169b8747d4
								
							
						
					
					
						commit
						40bfd207f5
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -260,7 +260,9 @@ func (t *dht) handleRes(res *dhtRes) {
 | 
			
		|||
		key:    res.Key,
 | 
			
		||||
		coords: res.Coords,
 | 
			
		||||
	}
 | 
			
		||||
	t.insert(&rinfo)
 | 
			
		||||
	if _, isIn := t.table[*rinfo.getNodeID()]; isIn || t.isImportant(&rinfo) {
 | 
			
		||||
		t.insert(&rinfo)
 | 
			
		||||
	}
 | 
			
		||||
	for _, info := range res.Infos {
 | 
			
		||||
		if *info.getNodeID() == t.nodeID {
 | 
			
		||||
			continue
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue