Detect library failures

This commit is contained in:
Aditya Kulkarni
2019-10-26 10:49:12 -07:00
parent dedf36b51d
commit 131d830fbc

View File

@@ -51,7 +51,13 @@ void ConnectionLoader::doAutoConnect() {
// Check to see if there's an existing wallet
if (litelib_wallet_exists(Settings::getChainName().toStdString().c_str())) {
main->logger->write(QObject::tr("Using existing wallet."));
litelib_initialize_existing(config->dangerous, config->server.toStdString().c_str());
char* resp = litelib_initialize_existing(config->dangerous, config->server.toStdString().c_str());
QString response = litelib_process_response(resp);
if (response.toUpper().trimmed() != "OK") {
showError(response);
return;
}
} else {
main->logger->write(QObject::tr("Create/restore wallet."));
createOrRestore(config->dangerous, config->server);