squash two ifs together
This commit is contained in:
1 parent
57aecb868f
commit
997e6ed2b9
1 file changed
+2
-4
@@ -345,10 +345,8 @@ func (conn *LocalConnection) handshake(acceptNewPeer bool) error {
|
|||||||
return fmt.Errorf("Found unknown remote name: %s at %s", name, conn.remoteTCPAddr)
|
return fmt.Errorf("Found unknown remote name: %s at %s", name, conn.remoteTCPAddr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if existingConn, found := conn.local.ConnectionTo(name); found {
|
if existingConn, found := conn.local.ConnectionTo(name); found && existingConn.Established() {
|
||||||
if existingConn.Established() {
|
return fmt.Errorf("Already have connection to %s at %s", name, existingConn.RemoteTCPAddr())
|
||||||
return fmt.Errorf("Already have connection to %s at %s", name, existingConn.RemoteTCPAddr())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uidStr, err := checkHandshakeStringField("UID", "", handshakeRecv)
|
uidStr, err := checkHandshakeStringField("UID", "", handshakeRecv)
|
||||||
|
|||||||
Reference in new issue
Block a user