From ebca06234ab4110d39ebe00bc8ae6bb32672e08c Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Mon, 15 Oct 2018 22:25:41 +0300 Subject: [PATCH] Fix initial connection when launch new instance of Manager Signed-off-by: Vitalii Koshura --- clientgui/MainDocument.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 79c6b5c8f8..7a89f45173 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -586,14 +586,15 @@ int CMainDocument::OnPoll() { pFrame->OnExit(event); // Exit if Select Computer dialog cancelled } } - if (wxGetApp().GetNeedRunDaemon()) { - if (m_pClientManager->StartupBOINCCore()) { - Connect(wxT("localhost"), portNum, password, TRUE, TRUE); - } - else { - m_pNetworkConnection->ForceDisconnect(); - pFrame->ShowDaemonStartFailedAlert(); - } + } + + if (wxGetApp().GetNeedRunDaemon() && IsComputerNameLocal(hostName)) { + if (m_pClientManager->StartupBOINCCore()) { + Connect(wxT("localhost"), portNum, password, TRUE, TRUE); + } + else { + m_pNetworkConnection->ForceDisconnect(); + pFrame->ShowDaemonStartFailedAlert(); } } else { Connect(hostName, portNum, password, TRUE, password.IsEmpty());