mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Use mutex in switch/tcp init
This commit is contained in:
parent
fa7c4117b4
commit
2925920c70
2 changed files with 4 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue