Skip to content

Commit f845625

Browse files
author
MarcoFalke
committed
Merge #14783: gui: Fix boost::signals2::no_slots_error in early calls to InitWarning
6bbdb20 squashme: connect thru node interface (João Barbosa) a0f8df3 qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning (João Barbosa) Pull request description: Adding the following to `bitcoin.conf` ``` [xxx] disablewallet=1 ``` And running `bitcoin-qt` gives: ``` libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::signals2::no_slots_error> >: boost::signals2::no_slots_error ``` Fixes regression in #14708. Tree-SHA512: 7c158376fad6ebcd80fc0dbe549d5b6e893fb82e7dc1e455825633d7f91b14dc34493487cab7642152e88f9eaf99bfa91988972d600e9fb289cf26afd64aff8a
2 parents 23a1fa0 + 6bbdb20 commit f845625

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/qt/bitcoin.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ Q_DECLARE_METATYPE(bool*)
7171
Q_DECLARE_METATYPE(CAmount)
7272
Q_DECLARE_METATYPE(uint256)
7373

74-
static void InitMessage(const std::string& message)
75-
{
76-
noui_InitMessage(message);
77-
}
78-
7974
/** Translate string to current locale using Qt. */
8075
const std::function<std::string(const char*)> G_TRANSLATION_FUN = [](const char* psz) {
8176
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
@@ -563,6 +558,11 @@ int main(int argc, char *argv[])
563558

564559
std::unique_ptr<interfaces::Node> node = interfaces::MakeNode();
565560

561+
// Subscribe to global signals from core
562+
std::unique_ptr<interfaces::Handler> handler_message_box = node->handleMessageBox(noui_ThreadSafeMessageBox);
563+
std::unique_ptr<interfaces::Handler> handler_question = node->handleQuestion(noui_ThreadSafeQuestion);
564+
std::unique_ptr<interfaces::Handler> handler_init_message = node->handleInitMessage(noui_InitMessage);
565+
566566
// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
567567

568568
/// 1. Basic Qt initialization (not dependent on parameters or configuration)
@@ -696,9 +696,6 @@ int main(int argc, char *argv[])
696696
// Load GUI settings from QSettings
697697
app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false));
698698

699-
// Subscribe to global signals from core
700-
std::unique_ptr<interfaces::Handler> handler = node->handleInitMessage(InitMessage);
701-
702699
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
703700
app.createSplashScreen(networkStyle.data());
704701

src/qt/bitcoingui.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <chainparams.h>
3232
#include <interfaces/handler.h>
3333
#include <interfaces/node.h>
34-
#include <noui.h>
3534
#include <ui_interface.h>
3635
#include <util/system.h>
3736

@@ -1226,9 +1225,6 @@ void BitcoinGUI::showModalOverlay()
12261225

12271226
static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, const std::string& caption, unsigned int style)
12281227
{
1229-
// Redundantly log and print message in non-gui fashion
1230-
noui_ThreadSafeMessageBox(message, caption, style);
1231-
12321228
bool modal = (style & CClientUIInterface::MODAL);
12331229
// The SECURE flag has no effect in the Qt GUI.
12341230
// bool secure = (style & CClientUIInterface::SECURE);

0 commit comments

Comments
 (0)