mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	change how searches are initialized so we actually send a dhtReq to ourself and get a response, in case we're the destination
This commit is contained in:
		
							parent
							
								
									9b99f0b5e4
								
							
						
					
					
						commit
						e5bb9bcb8d
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -179,8 +179,12 @@ func (sinfo *searchInfo) continueSearch() {
 | 
			
		|||
// Calls create search, and initializes the iterative search parts of the struct before returning it.
 | 
			
		||||
func (s *searches) newIterSearch(dest *crypto.NodeID, mask *crypto.NodeID, callback func(*sessionInfo, error)) *searchInfo {
 | 
			
		||||
	sinfo := s.createSearch(dest, mask, callback)
 | 
			
		||||
	sinfo.toVisit = s.core.dht.lookup(dest, true)
 | 
			
		||||
	sinfo.visited = make(map[crypto.NodeID]bool)
 | 
			
		||||
	loc := s.core.switchTable.getLocator()
 | 
			
		||||
	sinfo.toVisit = append(sinfo.toVisit, &dhtInfo{
 | 
			
		||||
		key:    s.core.boxPub,
 | 
			
		||||
		coords: loc.getCoords(),
 | 
			
		||||
	}) // Start the search by asking ourself, useful if we're the destination
 | 
			
		||||
	return sinfo
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue