Skip to content

Commit

Permalink
Merge bitcoin#14783: gui: Fix boost::signals2::no_slots_error in earl…
Browse files Browse the repository at this point in the history
…y 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 bitcoin#14708.

Tree-SHA512: 7c158376fad6ebcd80fc0dbe549d5b6e893fb82e7dc1e455825633d7f91b14dc34493487cab7642152e88f9eaf99bfa91988972d600e9fb289cf26afd64aff8a
  • Loading branch information
MarcoFalke authored and linuxsh2 committed Jul 29, 2021
1 parent 660394e commit e3f0da1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/qt/bitcoingui.cpp
Expand Up @@ -31,7 +31,6 @@
#include <chainparams.h>
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <noui.h>
#include <ui_interface.h>
#include <util/system.h>
#include <qt/masternodelist.h>
Expand Down Expand Up @@ -1768,9 +1767,6 @@ void BitcoinGUI::showModalOverlay()

static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, const std::string& caption, unsigned int style)
{
// Redundantly log and print message in non-gui fashion
noui_ThreadSafeMessageBox(message, caption, style);

bool modal = (style & CClientUIInterface::MODAL);
// The SECURE flag has no effect in the Qt GUI.
// bool secure = (style & CClientUIInterface::SECURE);
Expand Down
13 changes: 5 additions & 8 deletions src/qt/dash.cpp
Expand Up @@ -71,11 +71,6 @@ Q_DECLARE_METATYPE(bool*)
Q_DECLARE_METATYPE(CAmount)
Q_DECLARE_METATYPE(uint256)

static void InitMessage(const std::string& message)
{
noui_InitMessage(message);
}

/** Translate string to current locale using Qt. */
const std::function<std::string(const char*)> G_TRANSLATION_FUN = [](const char* psz) {
return QCoreApplication::translate("dash-core", psz).toStdString();
Expand Down Expand Up @@ -576,6 +571,11 @@ int main(int argc, char *argv[])

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

// Subscribe to global signals from core
std::unique_ptr<interfaces::Handler> handler_message_box = node->handleMessageBox(noui_ThreadSafeMessageBox);
std::unique_ptr<interfaces::Handler> handler_question = node->handleQuestion(noui_ThreadSafeQuestion);
std::unique_ptr<interfaces::Handler> handler_init_message = node->handleInitMessage(noui_InitMessage);

// Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory

/// 1. Basic Qt initialization (not dependent on parameters or configuration)
Expand Down Expand Up @@ -804,9 +804,6 @@ int main(int argc, char *argv[])
"Warning: UI debug mode (-debug-ui) enabled" + QString(gArgs.IsArgSet("-custom-css-dir") ? "." : " without a custom css directory set with -custom-css-dir."));
}

// Subscribe to global signals from core
std::unique_ptr<interfaces::Handler> handler = node->handleInitMessage(InitMessage);

if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
app.createSplashScreen(networkStyle.data());

Expand Down

0 comments on commit e3f0da1

Please sign in to comment.