Browse Source

Fix some more branding when autoconnecting

pull/45/head
Jonathan "Duke" Leto 5 years ago
parent
commit
e52b31b43b
  1. 22
      src/connection.cpp

22
src/connection.cpp

@ -51,29 +51,29 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
// Refused connection. So try and start embedded zcashd // Refused connection. So try and start embedded zcashd
if (Settings::getInstance()->useEmbedded()) { if (Settings::getInstance()->useEmbedded()) {
if (tryEzcashdStart) { if (tryEzcashdStart) {
this->showInformation(QObject::tr("Starting embedded zcashd")); this->showInformation(QObject::tr("Starting embedded hushd"));
if (this->startEmbeddedZcashd()) { if (this->startEmbeddedZcashd()) {
// Embedded zcashd started up. Wait a second and then refresh the connection // 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(); } ); QTimer::singleShot(1000, [=]() { doAutoConnect(); } );
} else { } else {
if (config->zcashDaemon) { 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. // to let it start up.
main->logger->write("zcashd is daemon=1. Waiting for it to start up"); main->logger->write("hushd 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")); 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 ezcashd */ false); }); QTimer::singleShot(5000, [=]() { doAutoConnect(/* don't attempt to start ehushd */ false); });
} else { } else {
// Something is wrong. // Something is wrong.
// We're going to attempt to connect to the one in the background one last time // 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 // 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); }); QTimer::singleShot(2000, [=]() { doAutoConnect(/* don't attempt to start ezcashd */ false); });
} }
} }
} else { } else {
// We tried to start ezcashd previously, and it didn't work. So, show the error. // 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; QString explanation;
if (config->zcashDaemon) { if (config->zcashDaemon) {
explanation = QString() % QObject::tr("You have komodod set to start as a daemon, which can cause problems " 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" "Please remove the following line from your HUSH3.conf and restart SilentDragon\n"
"daemon=1"); "daemon=1");
} else { } 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" "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("")); (ezcashd ? QObject::tr("The process returned") + ":\n\n" % ezcashd->errorString() : QString(""));
} }
@ -563,6 +563,8 @@ QString ConnectionLoader::zcashParamsDir() {
bool ConnectionLoader::verifyParams() { bool ConnectionLoader::verifyParams() {
QDir paramsDir(zcashParamsDir()); QDir paramsDir(zcashParamsDir());
qDebug() << "Verifying param files exist";
if (!QFile(paramsDir.filePath("sapling-output.params")).exists()) return false; if (!QFile(paramsDir.filePath("sapling-output.params")).exists()) return false;
if (!QFile(paramsDir.filePath("sapling-spend.params")).exists()) return false; if (!QFile(paramsDir.filePath("sapling-spend.params")).exists()) return false;
//TODO: sprout probably not needed //TODO: sprout probably not needed

Loading…
Cancel
Save