Skip to content

Commit

Permalink
Fix crashes in release build, ZEC price
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapk00 committed Nov 2, 2018
1 parent 04036f9 commit 59964c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down Expand Up @@ -97,19 +97,19 @@ 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 "
% "please set the host/port and user/password in the File->Settings menu";

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";

Expand Down
2 changes: 2 additions & 0 deletions src/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void RPC::setConnection(Connection* c) {
delete conn;
this->conn = c;

refreshZECPrice();
refresh();
}

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 59964c9

Please sign in to comment.