From 131d830fbcbf1a1ee3082eda641cc2cdf98389e4 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Sat, 26 Oct 2019 10:49:12 -0700 Subject: [PATCH] Detect library failures --- src/connection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/connection.cpp b/src/connection.cpp index 2d5048e..de65e18 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -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);