From 59964c9f91f29afc5c24c2a22e74907a1825eac6 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 2 Nov 2018 10:17:18 -0700 Subject: [PATCH] Fix crashes in release build, ZEC price --- src/connection.cpp | 8 ++++---- src/rpc.cpp | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index bb7bf41..8359c5d 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -40,7 +40,7 @@ void ConnectionLoader::loadConnection() { if (config.get() == nullptr) { d->show(); // Nothing configured, show an error - auto explanation = QString() + QString explanation = QString() % "A zcash.conf was not found on this machine.\n\n" % "If you are connecting to a remote/non-standard node " % "please set the host/port and user/password in the File->Settings menu."; @@ -97,11 +97,11 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) { auto err = reply->error(); // Failed, see what it is. - qDebug() << err << ":" << QString::fromStdString(res.dump()); + //qDebug() << err << ":" << QString::fromStdString(res.dump()); if (err == QNetworkReply::NetworkError::ConnectionRefusedError) { auto isZcashConfFound = connection->config.get()->usingZcashConf; - auto explanation = QString() + QString explanation = QString() % (isZcashConfFound ? "A zcash.conf file was found, but a" : "A") % " connection to zcashd could not be established.\n\n" % "If you are connecting to a remote/non-standard node " @@ -109,7 +109,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) { this->showError(explanation); } else if (err == QNetworkReply::NetworkError::AuthenticationRequiredError) { - auto explanation = QString() + QString explanation = QString() % "Authentication failed. The username / password you specified was " % "not accepted by zcashd. Try changing it in the File->Settings menu"; diff --git a/src/rpc.cpp b/src/rpc.cpp index d2854c9..f3dc59c 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -68,6 +68,7 @@ void RPC::setConnection(Connection* c) { delete conn; this->conn = c; + refreshZECPrice(); refresh(); } @@ -754,6 +755,7 @@ void RPC::watchTxStatus() { // Get the ZEC->USD price from coinmarketcap using their API void RPC::refreshZECPrice() { + qDebug() << QString::fromStdString("Getting zec price"); if (conn == nullptr) return noConnection();