mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Fix panic when determining if CKR is enabled
This commit is contained in:
		
							parent
							
								
									e430d16018
								
							
						
					
					
						commit
						f0422dbd8b
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -115,12 +115,13 @@ func (c *cryptokey) configure() error {
 | 
			
		|||
 | 
			
		||||
// Enable or disable crypto-key routing.
 | 
			
		||||
func (c *cryptokey) setEnabled(enabled bool) {
 | 
			
		||||
	c.enabled.Store(true)
 | 
			
		||||
	c.enabled.Store(enabled)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Check if crypto-key routing is enabled.
 | 
			
		||||
func (c *cryptokey) isEnabled() bool {
 | 
			
		||||
	return c.enabled.Load().(bool)
 | 
			
		||||
	enabled, ok := c.enabled.Load().(bool)
 | 
			
		||||
	return ok && enabled
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Check whether the given address (with the address length specified in bytes)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue