mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-06 06:24:06 +00:00
Use mutex in switch/tcp init
This commit is contained in:
@ -186,7 +186,9 @@ func (t *switchTable) init(core *Core) {
|
||||
now := time.Now()
|
||||
t.core = core
|
||||
t.reconfigure = make(chan bool, 1)
|
||||
t.core.configMutex.RLock()
|
||||
t.key = t.core.sigPub
|
||||
t.core.configMutex.RUnlock()
|
||||
locator := switchLocator{root: t.key, tstamp: now.Unix()}
|
||||
peers := make(map[switchPort]peerInfo)
|
||||
t.data = switchData{locator: locator, peers: peers}
|
||||
|
Reference in New Issue
Block a user