mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	don't change dhtInfo.pings when sending a search, to prevent multiple different searches from evicting a node
This commit is contained in:
		
							parent
							
								
									6bdc9a7eb6
								
							
						
					
					
						commit
						ea1d21f7e5
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -107,7 +107,10 @@ func (s *searches) doSearchStep(sinfo *searchInfo) {
 | 
				
			||||||
		// Send to the next search target
 | 
							// Send to the next search target
 | 
				
			||||||
		var next *dhtInfo
 | 
							var next *dhtInfo
 | 
				
			||||||
		next, sinfo.toVisit = sinfo.toVisit[0], sinfo.toVisit[1:]
 | 
							next, sinfo.toVisit = sinfo.toVisit[0], sinfo.toVisit[1:]
 | 
				
			||||||
 | 
							var oldPings int
 | 
				
			||||||
 | 
							oldPings, next.pings = next.pings, 0
 | 
				
			||||||
		s.core.dht.ping(next, &sinfo.dest)
 | 
							s.core.dht.ping(next, &sinfo.dest)
 | 
				
			||||||
 | 
							next.pings = oldPings // Don't evict a node for searching with it too much
 | 
				
			||||||
		sinfo.visited[*next.getNodeID()] = true
 | 
							sinfo.visited[*next.getNodeID()] = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue