Fix crashes in release build, ZEC price
This commit is contained in:
@@ -40,7 +40,7 @@ void ConnectionLoader::loadConnection() {
|
|||||||
if (config.get() == nullptr) {
|
if (config.get() == nullptr) {
|
||||||
d->show();
|
d->show();
|
||||||
// Nothing configured, show an error
|
// Nothing configured, show an error
|
||||||
auto explanation = QString()
|
QString explanation = QString()
|
||||||
% "A zcash.conf was not found on this machine.\n\n"
|
% "A zcash.conf was not found on this machine.\n\n"
|
||||||
% "If you are connecting to a remote/non-standard node "
|
% "If you are connecting to a remote/non-standard node "
|
||||||
% "please set the host/port and user/password in the File->Settings menu.";
|
% "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();
|
auto err = reply->error();
|
||||||
// Failed, see what it is.
|
// Failed, see what it is.
|
||||||
qDebug() << err << ":" << QString::fromStdString(res.dump());
|
//qDebug() << err << ":" << QString::fromStdString(res.dump());
|
||||||
|
|
||||||
if (err == QNetworkReply::NetworkError::ConnectionRefusedError) {
|
if (err == QNetworkReply::NetworkError::ConnectionRefusedError) {
|
||||||
auto isZcashConfFound = connection->config.get()->usingZcashConf;
|
auto isZcashConfFound = connection->config.get()->usingZcashConf;
|
||||||
auto explanation = QString()
|
QString explanation = QString()
|
||||||
% (isZcashConfFound ? "A zcash.conf file was found, but a" : "A")
|
% (isZcashConfFound ? "A zcash.conf file was found, but a" : "A")
|
||||||
% " connection to zcashd could not be established.\n\n"
|
% " connection to zcashd could not be established.\n\n"
|
||||||
% "If you are connecting to a remote/non-standard node "
|
% "If you are connecting to a remote/non-standard node "
|
||||||
@@ -109,7 +109,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) {
|
|||||||
|
|
||||||
this->showError(explanation);
|
this->showError(explanation);
|
||||||
} else if (err == QNetworkReply::NetworkError::AuthenticationRequiredError) {
|
} else if (err == QNetworkReply::NetworkError::AuthenticationRequiredError) {
|
||||||
auto explanation = QString()
|
QString explanation = QString()
|
||||||
% "Authentication failed. The username / password you specified was "
|
% "Authentication failed. The username / password you specified was "
|
||||||
% "not accepted by zcashd. Try changing it in the File->Settings menu";
|
% "not accepted by zcashd. Try changing it in the File->Settings menu";
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ void RPC::setConnection(Connection* c) {
|
|||||||
delete conn;
|
delete conn;
|
||||||
this->conn = c;
|
this->conn = c;
|
||||||
|
|
||||||
|
refreshZECPrice();
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,6 +755,7 @@ void RPC::watchTxStatus() {
|
|||||||
|
|
||||||
// Get the ZEC->USD price from coinmarketcap using their API
|
// Get the ZEC->USD price from coinmarketcap using their API
|
||||||
void RPC::refreshZECPrice() {
|
void RPC::refreshZECPrice() {
|
||||||
|
qDebug() << QString::fromStdString("Getting zec price");
|
||||||
if (conn == nullptr)
|
if (conn == nullptr)
|
||||||
return noConnection();
|
return noConnection();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user