mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	fix my terrible bug, I have no idea why the old one even worked
This commit is contained in:
		
							parent
							
								
									9c028e1d0d
								
							
						
					
					
						commit
						03949dcf3f
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -624,8 +624,10 @@ func (t *switchTable) handleIdle(port switchPort, stacks map[string][][]byte) bo
 | 
				
			||||||
	var bestSize int
 | 
						var bestSize int
 | 
				
			||||||
	for streamID, packets := range stacks {
 | 
						for streamID, packets := range stacks {
 | 
				
			||||||
		// Filter over the streams that this node is closer to
 | 
							// Filter over the streams that this node is closer to
 | 
				
			||||||
 | 
							// Keep the one with the smallest queue
 | 
				
			||||||
		packet := packets[len(packets)-1]
 | 
							packet := packets[len(packets)-1]
 | 
				
			||||||
		if (bestSize == 0 || len(packets) < bestSize) && t.portIsCloser(packet, port) {
 | 
							coords := switch_getPacketCoords(packet)
 | 
				
			||||||
 | 
							if (bestSize == 0 || len(packets) < bestSize) && t.portIsCloser(coords, port) {
 | 
				
			||||||
			best = streamID
 | 
								best = streamID
 | 
				
			||||||
			bestSize = len(packets)
 | 
								bestSize = len(packets)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue