|
|
@ -51,29 +51,29 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { |
|
|
|
// Refused connection. So try and start embedded zcashd
|
|
|
|
if (Settings::getInstance()->useEmbedded()) { |
|
|
|
if (tryEzcashdStart) { |
|
|
|
this->showInformation(QObject::tr("Starting embedded zcashd")); |
|
|
|
this->showInformation(QObject::tr("Starting embedded hushd")); |
|
|
|
if (this->startEmbeddedZcashd()) { |
|
|
|
// Embedded zcashd started up. Wait a second and then refresh the connection
|
|
|
|
main->logger->write("Embedded zcashd started up, trying autoconnect in 1 sec"); |
|
|
|
main->logger->write("Embedded hushd started up, trying autoconnect in 1 sec"); |
|
|
|
QTimer::singleShot(1000, [=]() { doAutoConnect(); } ); |
|
|
|
} else { |
|
|
|
if (config->zcashDaemon) { |
|
|
|
// zcashd is configured to run as a daemon, so we must wait for a few seconds
|
|
|
|
// hushd is configured to run as a daemon, so we must wait for a few seconds
|
|
|
|
// to let it start up.
|
|
|
|
main->logger->write("zcashd is daemon=1. Waiting for it to start up"); |
|
|
|
this->showInformation(QObject::tr("zcashd is set to run as daemon"), QObject::tr("Waiting for zcashd")); |
|
|
|
QTimer::singleShot(5000, [=]() { doAutoConnect(/* don't attempt to start ezcashd */ false); }); |
|
|
|
main->logger->write("hushd is daemon=1. Waiting for it to start up"); |
|
|
|
this->showInformation(QObject::tr("hushd is set to run as daemon"), QObject::tr("Waiting for hushd")); |
|
|
|
QTimer::singleShot(5000, [=]() { doAutoConnect(/* don't attempt to start ehushd */ false); }); |
|
|
|
} else { |
|
|
|
// Something is wrong.
|
|
|
|
// We're going to attempt to connect to the one in the background one last time
|
|
|
|
// and see if that works, else throw an error
|
|
|
|
main->logger->write("Unknown problem while trying to start zcashd"); |
|
|
|
main->logger->write("Unknown problem while trying to start hushd!"); |
|
|
|
QTimer::singleShot(2000, [=]() { doAutoConnect(/* don't attempt to start ezcashd */ false); }); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// We tried to start ezcashd previously, and it didn't work. So, show the error.
|
|
|
|
main->logger->write("Couldn't start embedded zcashd for unknown reason"); |
|
|
|
main->logger->write("Couldn't start embedded hushd for unknown reason"); |
|
|
|
QString explanation; |
|
|
|
if (config->zcashDaemon) { |
|
|
|
explanation = QString() % QObject::tr("You have komodod set to start as a daemon, which can cause problems " |
|
|
@ -81,9 +81,9 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) { |
|
|
|
"Please remove the following line from your HUSH3.conf and restart SilentDragon\n" |
|
|
|
"daemon=1"); |
|
|
|
} else { |
|
|
|
explanation = QString() % QObject::tr("Couldn't start the embedded komodod.\n\n" |
|
|
|
explanation = QString() % QObject::tr("Couldn't start the embedded hushd.\n\n" |
|
|
|
"Please try restarting.\n\nIf you previously started komodod with custom arguments, you might need to reset HUSH3.conf.\n\n" |
|
|
|
"If all else fails, please run zcashd manually.") % |
|
|
|
"If all else fails, please run hushd manually.") % |
|
|
|
(ezcashd ? QObject::tr("The process returned") + ":\n\n" % ezcashd->errorString() : QString("")); |
|
|
|
} |
|
|
|
|
|
|
@ -563,6 +563,8 @@ QString ConnectionLoader::zcashParamsDir() { |
|
|
|
bool ConnectionLoader::verifyParams() { |
|
|
|
QDir paramsDir(zcashParamsDir()); |
|
|
|
|
|
|
|
qDebug() << "Verifying param files exist"; |
|
|
|
|
|
|
|
if (!QFile(paramsDir.filePath("sapling-output.params")).exists()) return false; |
|
|
|
if (!QFile(paramsDir.filePath("sapling-spend.params")).exists()) return false; |
|
|
|
//TODO: sprout probably not needed
|
|
|
|