mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-14 22:34:18 +03:00
device: defer state machine transitions until configuration is complete
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
1 parent
63abb5537b
commit
e3134bf665
3 files changed
+18
-15
No files matched your search
+3
-6
@@ -107,15 +107,12 @@ func (device *Device) NewPeer(pk NoisePublicKey) (*Peer, error) {
|
||||
// reset endpoint
|
||||
peer.endpoint = nil
|
||||
|
||||
// init timers
|
||||
peer.timersInit()
|
||||
|
||||
// add
|
||||
device.peers.keyMap[pk] = peer
|
||||
|
||||
// start peer
|
||||
peer.timersInit()
|
||||
if peer.device.isUp() {
|
||||
peer.Start()
|
||||
}
|
||||
|
||||
return peer, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user