Skip to content

Instantly share code, notes, and snippets.

@hebasto
Last active April 30, 2019 11:21
Show Gist options
  • Save hebasto/cf5c0d43f6d4edd64f01835a326880b8 to your computer and use it in GitHub Desktop.
Save hebasto/cf5c0d43f6d4edd64f01835a326880b8 to your computer and use it in GitHub Desktop.
Details of ThreadSafeMessageBox using in Bitcoin Core

The ThreadSafeMessageBox() messages are rendered in two ways:

  • by noui_ThreadSafeMessageBox() using LogPrintf() and fprintf(stderr, ...) with adding translated type prefix ("Error" / "Warning" / "Information")
  • by BitcoinGUI::message() using QMessageBox with adding translated type suffix ("Error" / "Warning" / "Information") to the window title. Note: On macOS, the window title is ignored (as required by the macOS Guidelines)

The ThreadSafeMessageBox() is called by some functions:

  • AbortNode() and InitRPCAuthentication() pass translated messages with "Error: " prefix
  • FatalError() passes non-translated messages with "Error: " prefix
  • InitError(); some passed messages are translated, some are not
  • InitWarning() passes translated messages
  • InitHTTPAllowList() passes non-translated messages
  • CCoinsViewErrorCatcher::GetCoin() pass translated message started with "Error"
  • CConnman::BindListenPort() via CConnman::Bind() passes:
    • non-translated messages with "Error: " prefix
    • translated messages without any prefix
    • translated messages with "Error: " prefix
  • CConnman::Start() passes translated messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment