mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	switch cleanup
This commit is contained in:
		
							parent
							
								
									6b51b44cbf
								
							
						
					
					
						commit
						d98640fd59
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
					@ -127,8 +127,7 @@ type switchMessage struct {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type switchPort uint64
 | 
					type switchPort uint64
 | 
				
			||||||
type tableElem struct {
 | 
					type tableElem struct {
 | 
				
			||||||
	port switchPort
 | 
						port    switchPort
 | 
				
			||||||
	//firstSeen time.Time
 | 
					 | 
				
			||||||
	locator switchLocator
 | 
						locator switchLocator
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -304,7 +303,6 @@ func (t *switchTable) handleMessage(msg *switchMessage, fromPort switchPort, sig
 | 
				
			||||||
	doUpdate := false
 | 
						doUpdate := false
 | 
				
			||||||
	if !equiv(&msg.locator, &oldSender.locator) {
 | 
						if !equiv(&msg.locator, &oldSender.locator) {
 | 
				
			||||||
		doUpdate = true
 | 
							doUpdate = true
 | 
				
			||||||
		//sender.firstSeen = now
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	t.data.peers[fromPort] = sender
 | 
						t.data.peers[fromPort] = sender
 | 
				
			||||||
	updateRoot := false
 | 
						updateRoot := false
 | 
				
			||||||
| 
						 | 
					@ -396,10 +394,7 @@ func (t *switchTable) updateTable() {
 | 
				
			||||||
		loc.coords = loc.coords[:len(loc.coords)-1] // Remove the them->self link
 | 
							loc.coords = loc.coords[:len(loc.coords)-1] // Remove the them->self link
 | 
				
			||||||
		newTable.elems = append(newTable.elems, tableElem{
 | 
							newTable.elems = append(newTable.elems, tableElem{
 | 
				
			||||||
			locator: loc,
 | 
								locator: loc,
 | 
				
			||||||
			//degree: pinfo.degree,
 | 
								port:    pinfo.port,
 | 
				
			||||||
			//firstSeen: pinfo.firstSeen,
 | 
					 | 
				
			||||||
			//forward: pinfo.forward,
 | 
					 | 
				
			||||||
			port: pinfo.port,
 | 
					 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	t.table.Store(newTable)
 | 
						t.table.Store(newTable)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue