diff --git a/uapi.go b/uapi.go index 53a598e..9858f60 100644 --- a/uapi.go +++ b/uapi.go @@ -235,14 +235,13 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError { dummy = device.staticIdentity.publicKey.Equals(publicKey) device.staticIdentity.mutex.RUnlock() + if dummy { peer = &Peer{} + } else { + peer = device.LookupPeer(publicKey) } - // find peer referenced - - peer = device.LookupPeer(publicKey) - if peer == nil { peer, err = device.NewPeer(publicKey) if err != nil {