diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-24 15:34:17 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-24 15:34:44 +0200 |
commit | 25190e43369a79dc77a740dc8cd28b8a9fcb235e (patch) | |
tree | b7057627e0710fe9ef40c077a204904c78bed9cc /src/config.go | |
parent | 521e77fd54fba275405affd790ac91f7998e4559 (diff) |
Restructuring of noise impl.
Diffstat (limited to 'src/config.go')
-rw-r--r-- | src/config.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/config.go b/src/config.go index a61b940..8865194 100644 --- a/src/config.go +++ b/src/config.go @@ -99,11 +99,7 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { if ok { peer = found } else { - newPeer := &Peer{ - publicKey: pubKey, - } - peer = newPeer - device.peers[pubKey] = newPeer + peer = device.NewPeer(pubKey) } case "replace_peers": @@ -125,14 +121,14 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { case "remove": peer.mutex.Lock() - device.RemovePeer(peer.publicKey) + // device.RemovePeer(peer.publicKey) peer = nil case "preshared_key": err := func() error { peer.mutex.Lock() defer peer.mutex.Unlock() - return peer.presharedKey.FromHex(value) + return peer.handshake.presharedKey.FromHex(value) }() if err != nil { return &IPCError{Code: ipcErrorInvalidPublicKey} @@ -144,7 +140,7 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { return &IPCError{Code: ipcErrorInvalidIPAddress} } peer.mutex.Lock() - peer.endpoint = ip + // peer.endpoint = ip FIX peer.mutex.Unlock() case "persistent_keepalive_interval": |