Try to avoid coredumping if zrpc object doesn't exist, which can happen if backend server is misbehaving
This commit is contained in:
@@ -1987,7 +1987,7 @@ void Controller::refreshHUSHPrice()
|
|||||||
void Controller::shutdownhushd()
|
void Controller::shutdownhushd()
|
||||||
{
|
{
|
||||||
// Save the wallet and exit the lightclient library cleanly.
|
// Save the wallet and exit the lightclient library cleanly.
|
||||||
if (zrpc->haveConnection())
|
if (zrpc && zrpc->haveConnection())
|
||||||
{
|
{
|
||||||
QDialog d(main);
|
QDialog d(main);
|
||||||
Ui_ConnectionDialog connD;
|
Ui_ConnectionDialog connD;
|
||||||
@@ -2010,7 +2010,7 @@ void Controller::shutdownhushd()
|
|||||||
connD.topIcon->setMovie(movie1);
|
connD.topIcon->setMovie(movie1);
|
||||||
movie1->start();
|
movie1->start();
|
||||||
connD.status->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
|
connD.status->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
|
||||||
connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit"));
|
connD.statusDetail->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
@@ -2018,10 +2018,13 @@ void Controller::shutdownhushd()
|
|||||||
if (!finished)
|
if (!finished)
|
||||||
d.accept();
|
d.accept();
|
||||||
finished = true;
|
finished = true;
|
||||||
|
qDebug() << "saveWallet during shutdownhushd";
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!finished)
|
if (!finished)
|
||||||
d.exec();
|
d.exec();
|
||||||
|
} else {
|
||||||
|
qDebug() << "No zrpc object, unclean shutdown and unable to call saveWallet!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user