Browse Source

Refactor

pull/7/head
Duke Leto 3 years ago
parent
commit
f8b87c3572
  1. 8
      src/connection.cpp
  2. 2
      src/connection.h
  3. 2
      src/rpc.cpp

8
src/connection.cpp

@ -71,7 +71,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
main->logger->write("Embedded hushd started up, trying autoconnect in 1 sec");
QTimer::singleShot(1000, [=]() { doAutoConnect(); } );
} else {
if (config->zcashDaemon) {
if (config->hushDaemon) {
// hushd is configured to run as a daemon, so we must wait for a few seconds
// to let it start up.
main->logger->write("hushd is daemon=1. Waiting for it to start up");
@ -89,7 +89,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
// We tried to start ehushd previously, and it didn't work. So, show the error.
main->logger->write("Couldn't start embedded hushd for unknown reason");
QString explanation;
if (config->zcashDaemon) {
if (config->hushDaemon) {
explanation = QString() % QObject::tr("You have hushd set to start as a daemon, which can cause problems "
"with SilentDragon\n\n."
"Please remove the following line from your HUSH3.conf and restart SilentDragon\n"
@ -655,7 +655,7 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectZcashConf() {
zcashconf->connType = ConnectionType::DetectedConfExternalHushD;
zcashconf->usingZcashConf = true;
zcashconf->zcashDir = QFileInfo(confLocation).absoluteDir().absolutePath();
zcashconf->zcashDaemon = false;
zcashconf->hushDaemon = false;
Settings::getInstance()->setUsingZcashConf(confLocation);
@ -675,7 +675,7 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectZcashConf() {
zcashconf->port = value;
}
if (name == "daemon" && value == "1") {
zcashconf->zcashDaemon = true;
zcashconf->hushDaemon = true;
}
if (name == "proxy") {
zcashconf->proxy = value;

2
src/connection.h

@ -21,7 +21,7 @@ struct ConnectionConfig {
QString rpcuser;
QString rpcpassword;
bool usingZcashConf;
bool zcashDaemon;
bool hushDaemon;
QString zcashDir;
QString proxy;
QString consolidation;

2
src/rpc.cpp

@ -1254,7 +1254,7 @@ void RPC::shutdownZcashd() {
if ((ehushd->atEnd() && ehushd->processId() == 0) ||
ehushd->state() == QProcess::NotRunning ||
waitCount > 30 ||
conn->config->zcashDaemon) { // If hushd is daemon, then we don't have to do anything else
conn->config->hushDaemon) { // If hushd is daemon, then we don't have to do anything else
qDebug() << "Ended";
waiter.stop();
QTimer::singleShot(1000, [&]() { d.accept(); });

Loading…
Cancel
Save