mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Update nodeinfo in router reconfigure
This commit is contained in:
		
							parent
							
								
									9e186bdd67
								
							
						
					
					
						commit
						5cde3b5efc
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -350,7 +350,10 @@ func (a *admin) init(c *Core) {
 | 
			
		|||
		}
 | 
			
		||||
		var box_pub_key, coords string
 | 
			
		||||
		if in["box_pub_key"] == nil && in["coords"] == nil {
 | 
			
		||||
			nodeinfo := []byte(a.core.nodeinfo.getNodeInfo())
 | 
			
		||||
			var nodeinfo []byte
 | 
			
		||||
			a.core.router.doAdmin(func() {
 | 
			
		||||
				nodeinfo = []byte(a.core.nodeinfo.getNodeInfo())
 | 
			
		||||
			})
 | 
			
		||||
			var jsoninfo interface{}
 | 
			
		||||
			if err := json.Unmarshal(nodeinfo, &jsoninfo); err != nil {
 | 
			
		||||
				return admin_info{}, err
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -127,7 +127,9 @@ func (r *router) mainLoop() {
 | 
			
		|||
		case f := <-r.admin:
 | 
			
		||||
			f()
 | 
			
		||||
		case e := <-r.reconfigure:
 | 
			
		||||
			e <- nil
 | 
			
		||||
			r.core.configMutex.RLock()
 | 
			
		||||
			e <- r.core.nodeinfo.setNodeInfo(r.core.config.NodeInfo, r.core.config.NodeInfoPrivacy)
 | 
			
		||||
			r.core.configMutex.RUnlock()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue