From c63198f1c787d69052d6332c5e52118f58eacf56 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Tue, 29 Nov 2016 01:00:11 +0000 Subject: Make QT runawayException call GetWarnings instead of directly access strMiscWarning. This is a first step in avoiding racy accesses to strMiscWarning. The change required moving GetWarnings and related globals to util. --- src/qt/bitcoin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 4f48e21a22..ba49830297 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -260,7 +260,7 @@ BitcoinCore::BitcoinCore(): void BitcoinCore::handleRunawayException(const std::exception *e) { PrintExceptionContinue(e, "Runaway exception"); - Q_EMIT runawayException(QString::fromStdString(strMiscWarning)); + Q_EMIT runawayException(QString::fromStdString(GetWarnings("gui"))); } void BitcoinCore::initialize() @@ -691,10 +691,10 @@ int main(int argc, char *argv[]) app.exec(); } catch (const std::exception& e) { PrintExceptionContinue(&e, "Runaway exception"); - app.handleRunawayException(QString::fromStdString(strMiscWarning)); + app.handleRunawayException(QString::fromStdString(GetWarnings("gui"))); } catch (...) { PrintExceptionContinue(NULL, "Runaway exception"); - app.handleRunawayException(QString::fromStdString(strMiscWarning)); + app.handleRunawayException(QString::fromStdString(GetWarnings("gui"))); } return app.getReturnValue(); } -- cgit v1.2.3 From 749be013f5cba0bbb01f1f89df77106aea5a4cc1 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Wed, 30 Nov 2016 06:07:42 +0000 Subject: Move GetWarnings() into its own file. --- src/qt/bitcoin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index ba49830297..cfd0955a74 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -30,6 +30,7 @@ #include "scheduler.h" #include "ui_interface.h" #include "util.h" +#include "warnings.h" #ifdef ENABLE_WALLET #include "wallet/wallet.h" -- cgit v1.2.3