|
|
@ -149,20 +149,30 @@ void ConnectionLoader::doAutoConnect() |
|
|
|
if (litelib_wallet_exists(Settings::getDefaultChainName().toStdString().c_str())) { |
|
|
|
qDebug() << __func__ << ": using existing wallet"; |
|
|
|
main->logger->write(QObject::tr("Using existing wallet.")); |
|
|
|
char* resp = litelib_initialize_existing( |
|
|
|
config->dangerous, |
|
|
|
config->server.toStdString().c_str() |
|
|
|
); |
|
|
|
QString response = litelib_process_response(resp); |
|
|
|
|
|
|
|
if (response.toUpper().trimmed() != "OK") { |
|
|
|
config->server = Settings::getRandomServer(); |
|
|
|
|
|
|
|
resp = litelib_initialize_existing( |
|
|
|
QString response = ""; |
|
|
|
try { |
|
|
|
char* resp = litelib_initialize_existing( |
|
|
|
config->dangerous, |
|
|
|
config->server.toStdString().c_str() |
|
|
|
); |
|
|
|
response = litelib_process_response(resp); |
|
|
|
} catch (const std::exception& e) { |
|
|
|
qDebug() << __func__ << ": caught an exception, ignoring: " << e.what(); |
|
|
|
} |
|
|
|
|
|
|
|
if (response.toUpper().trimmed() != "OK") { |
|
|
|
config->server = Settings::getRandomServer(); |
|
|
|
|
|
|
|
try { |
|
|
|
char* resp = litelib_initialize_existing( |
|
|
|
config->dangerous, |
|
|
|
config->server.toStdString().c_str() |
|
|
|
); |
|
|
|
response = litelib_process_response(resp); |
|
|
|
} catch (const std::exception& e) { |
|
|
|
qDebug() << __func__ << ": caught an exception, ignoring: " << e.what(); |
|
|
|
} |
|
|
|
|
|
|
|
if (response.toUpper().trimmed() != "OK") { |
|
|
|
QString resp = "Error when connecting to " + config->server + ": " + response; |
|
|
|