- Show no connection if zcashd connection fails

- Double click on balances table
This commit is contained in:
adityapk00
2018-11-10 11:51:30 -08:00
parent 037b3cf792
commit 3b43a57f35
2 changed files with 31 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ RPC::RPC(MainWindow* main) {
auto cl = new ConnectionLoader(main, this);
// Execute the load connection async, so we can set up the rest of RPC properly.
QTimer::singleShot(1, [=]() {cl->loadConnection(); });
QTimer::singleShot(1, [=]() { cl->loadConnection(); });
this->main = main;
this->ui = main->ui;
@@ -463,7 +463,7 @@ void RPC::getInfoThenRefresh(bool force) {
{"method", "getinfo"}
};
conn->doRPCIgnoreError(payload, [=] (const json& reply) {
conn->doRPC(payload, [=] (const json& reply) {
// Testnet?
if (!reply["testnet"].is_null()) {
Settings::getInstance()->setTestnet(reply["testnet"].get<json::boolean_t>());
@@ -549,7 +549,12 @@ void RPC::getInfoThenRefresh(bool force) {
main->statusIcon->setToolTip(tooltip);
});
});
}, [=](QNetworkReply* reply, const json& replyJson) {
// zcashd has probably disappeared.
this->noConnection();
QMessageBox::critical(main, "Connection Error", "There was an error connecting to zcashd. The error was: \n\n"
+ reply->errorString(), QMessageBox::StandardButton::Ok);
});
}
void RPC::refreshAddresses() {