Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
bitcoin.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
6 #include "bitcoin-config.h"
7 #endif
8 
9 #include "bitcoingui.h"
10 
11 #include "clientmodel.h"
12 #include "guiconstants.h"
13 #include "guiutil.h"
14 #include "intro.h"
15 #include "optionsmodel.h"
16 #include "splashscreen.h"
17 #include "utilitydialog.h"
18 #include "winshutdownmonitor.h"
19 #ifdef ENABLE_WALLET
20 #include "paymentserver.h"
21 #include "walletmodel.h"
22 #endif
23 
24 #include "init.h"
25 #include "main.h"
26 #include "rpcserver.h"
27 #include "ui_interface.h"
28 #include "util.h"
29 #ifdef ENABLE_WALLET
30 #include "wallet.h"
31 #endif
32 
33 #include <stdint.h>
34 
35 #include <boost/filesystem/operations.hpp>
36 #include <QApplication>
37 #include <QLibraryInfo>
38 #include <QLocale>
39 #include <QMessageBox>
40 #include <QSettings>
41 #include <QTimer>
42 #include <QTranslator>
43 #include <QThread>
44 
45 #if defined(QT_STATICPLUGIN)
46 #include <QtPlugin>
47 #if QT_VERSION < 0x050000
48 Q_IMPORT_PLUGIN(qcncodecs)
49 Q_IMPORT_PLUGIN(qjpcodecs)
50 Q_IMPORT_PLUGIN(qtwcodecs)
51 Q_IMPORT_PLUGIN(qkrcodecs)
52 Q_IMPORT_PLUGIN(qtaccessiblewidgets)
53 #else
54 Q_IMPORT_PLUGIN(AccessibleFactory)
55 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
56 #endif
57 #endif
58 
59 #if QT_VERSION < 0x050000
60 #include <QTextCodec>
61 #endif
62 
63 // Declare meta types used for QMetaObject::invokeMethod
64 Q_DECLARE_METATYPE(bool*)
65 
66 static void InitMessage(const std::string &message)
67 {
68  LogPrintf("init message: %s\n", message);
69 }
70 
71 /*
72  Translate string to current locale using Qt.
73  */
74 static std::string Translate(const char* psz)
75 {
76  return QCoreApplication::translate("bitcoin-core", psz).toStdString();
77 }
78 
80 static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator)
81 {
82  QSettings settings;
83 
84  // Remove old translators
85  QApplication::removeTranslator(&qtTranslatorBase);
86  QApplication::removeTranslator(&qtTranslator);
87  QApplication::removeTranslator(&translatorBase);
88  QApplication::removeTranslator(&translator);
89 
90  // Get desired locale (e.g. "de_DE")
91  // 1) System default language
92  QString lang_territory = QLocale::system().name();
93  // 2) Language from QSettings
94  QString lang_territory_qsettings = settings.value("language", "").toString();
95  if(!lang_territory_qsettings.isEmpty())
96  lang_territory = lang_territory_qsettings;
97  // 3) -lang command line argument
98  lang_territory = QString::fromStdString(GetArg("-lang", lang_territory.toStdString()));
99 
100  // Convert to "de" only by truncating "_DE"
101  QString lang = lang_territory;
102  lang.truncate(lang_territory.lastIndexOf('_'));
103 
104  // Load language files for configured locale:
105  // - First load the translator for the base language, without territory
106  // - Then load the more specific locale translator
107 
108  // Load e.g. qt_de.qm
109  if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
110  QApplication::installTranslator(&qtTranslatorBase);
111 
112  // Load e.g. qt_de_DE.qm
113  if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
114  QApplication::installTranslator(&qtTranslator);
115 
116  // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc)
117  if (translatorBase.load(lang, ":/translations/"))
118  QApplication::installTranslator(&translatorBase);
119 
120  // Load e.g. bitcoin_de_DE.qm (shortcut "de_DE" needs to be defined in bitcoin.qrc)
121  if (translator.load(lang_territory, ":/translations/"))
122  QApplication::installTranslator(&translator);
123 }
124 
125 /* qDebug() message handler --> debug.log */
126 #if QT_VERSION < 0x050000
127 void DebugMessageHandler(QtMsgType type, const char *msg)
128 {
129  Q_UNUSED(type);
130  LogPrint("qt", "GUI: %s\n", msg);
131 }
132 #else
133 void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
134 {
135  Q_UNUSED(type);
136  Q_UNUSED(context);
137  LogPrint("qt", "GUI: %s\n", qPrintable(msg));
138 }
139 #endif
140 
144 class BitcoinCore: public QObject
145 {
146  Q_OBJECT
147 public:
148  explicit BitcoinCore();
149 
150 public slots:
151  void initialize();
152  void shutdown();
153 
154 signals:
155  void initializeResult(int retval);
156  void shutdownResult(int retval);
157  void runawayException(const QString &message);
158 
159 private:
160  boost::thread_group threadGroup;
161 
163  void handleRunawayException(std::exception *e);
164 };
165 
168 {
169  Q_OBJECT
170 public:
171  explicit BitcoinApplication(int &argc, char **argv);
173 
174 #ifdef ENABLE_WALLET
175  void createPaymentServer();
177 #endif
178  void createOptionsModel();
181  void createWindow(bool isaTestNet);
183  void createSplashScreen(bool isaTestNet);
184 
186  void requestInitialize();
188  void requestShutdown();
189 
191  int getReturnValue() { return returnValue; }
192 
194  WId getMainWinId() const;
195 
196 public slots:
197  void initializeResult(int retval);
198  void shutdownResult(int retval);
200  void handleRunawayException(const QString &message);
201 
202 signals:
203  void requestedInitialize();
204  void requestedShutdown();
205  void stopThread();
207 
208 private:
209  QThread *coreThread;
214 #ifdef ENABLE_WALLET
215  PaymentServer* paymentServer;
216  WalletModel *walletModel;
217 #endif
219 
220  void startThread();
221 };
222 
223 #include "bitcoin.moc"
224 
226  QObject()
227 {
228 }
229 
230 void BitcoinCore::handleRunawayException(std::exception *e)
231 {
232  PrintExceptionContinue(e, "Runaway exception");
233  emit runawayException(QString::fromStdString(strMiscWarning));
234 }
235 
237 {
238  try
239  {
240  LogPrintf("Running AppInit2 in thread\n");
241  int rv = AppInit2(threadGroup);
242  if(rv)
243  {
244  /* Start a dummy RPC thread if no RPC thread is active yet
245  * to handle timeouts.
246  */
248  }
249  emit initializeResult(rv);
250  } catch (std::exception& e) {
252  } catch (...) {
254  }
255 }
256 
258 {
259  try
260  {
261  LogPrintf("Running Shutdown in thread\n");
262  threadGroup.interrupt_all();
263  threadGroup.join_all();
264  Shutdown();
265  LogPrintf("Shutdown finished\n");
266  emit shutdownResult(1);
267  } catch (std::exception& e) {
269  } catch (...) {
271  }
272 }
273 
275  QApplication(argc, argv),
276  coreThread(0),
277  optionsModel(0),
278  clientModel(0),
279  window(0),
280  pollShutdownTimer(0),
281 #ifdef ENABLE_WALLET
282  paymentServer(0),
283  walletModel(0),
284 #endif
285  returnValue(0)
286 {
287  setQuitOnLastWindowClosed(false);
288  startThread();
289 }
290 
292 {
293  LogPrintf("Stopping thread\n");
294  emit stopThread();
295  coreThread->wait();
296  LogPrintf("Stopped thread\n");
297 
298  delete window;
299  window = 0;
300 #ifdef ENABLE_WALLET
301  delete paymentServer;
302  paymentServer = 0;
303 #endif
304  delete optionsModel;
305  optionsModel = 0;
306 }
307 
308 #ifdef ENABLE_WALLET
309 void BitcoinApplication::createPaymentServer()
310 {
311  paymentServer = new PaymentServer(this);
312 }
313 #endif
314 
316 {
317  optionsModel = new OptionsModel();
318 }
319 
320 void BitcoinApplication::createWindow(bool isaTestNet)
321 {
322  window = new BitcoinGUI(isaTestNet, 0);
323 
324  pollShutdownTimer = new QTimer(window);
325  connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown()));
326  pollShutdownTimer->start(200);
327 }
328 
330 {
331  SplashScreen *splash = new SplashScreen(QPixmap(), 0, isaTestNet);
332  splash->setAttribute(Qt::WA_DeleteOnClose);
333  splash->show();
334  connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*)));
335 }
336 
338 {
339  coreThread = new QThread(this);
340  BitcoinCore *executor = new BitcoinCore();
341  executor->moveToThread(coreThread);
342 
343  /* communication to and from thread */
344  connect(executor, SIGNAL(initializeResult(int)), this, SLOT(initializeResult(int)));
345  connect(executor, SIGNAL(shutdownResult(int)), this, SLOT(shutdownResult(int)));
346  connect(executor, SIGNAL(runawayException(QString)), this, SLOT(handleRunawayException(QString)));
347  connect(this, SIGNAL(requestedInitialize()), executor, SLOT(initialize()));
348  connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown()));
349  /* make sure executor object is deleted in its own thread */
350  connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater()));
351  connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit()));
352 
353  coreThread->start();
354 }
355 
357 {
358  LogPrintf("Requesting initialize\n");
359  emit requestedInitialize();
360 }
361 
363 {
364  LogPrintf("Requesting shutdown\n");
365  window->hide();
367  pollShutdownTimer->stop();
368 
369 #ifdef ENABLE_WALLET
370  window->removeAllWallets();
371  delete walletModel;
372  walletModel = 0;
373 #endif
374  delete clientModel;
375  clientModel = 0;
376 
377  // Show a simple window indicating shutdown status
379 
380  // Request shutdown from core thread
381  emit requestedShutdown();
382 }
383 
385 {
386  LogPrintf("Initialization result: %i\n", retval);
387  // Set exit result: 0 if successful, 1 if failure
388  returnValue = retval ? 0 : 1;
389  if(retval)
390  {
391 #ifdef ENABLE_WALLET
393  paymentServer->setOptionsModel(optionsModel);
394 #endif
395 
396  emit splashFinished(window);
397 
400 
401 #ifdef ENABLE_WALLET
402  if(pwalletMain)
403  {
404  walletModel = new WalletModel(pwalletMain, optionsModel);
405 
406  window->addWallet("~Default", walletModel);
407  window->setCurrentWallet("~Default");
408 
409  connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),
410  paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));
411  }
412 #endif
413 
414  // If -min option passed, start window minimized.
415  if(GetBoolArg("-min", false))
416  {
417  window->showMinimized();
418  }
419  else
420  {
421  window->show();
422  }
423 #ifdef ENABLE_WALLET
424  // Now that initialization/startup is done, process any command-line
425  // bitcoin: URIs or payment requests:
426  connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),
427  window, SLOT(handlePaymentRequest(SendCoinsRecipient)));
428  connect(window, SIGNAL(receivedURI(QString)),
429  paymentServer, SLOT(handleURIOrFile(QString)));
430  connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)),
431  window, SLOT(message(QString,QString,unsigned int)));
432  QTimer::singleShot(100, paymentServer, SLOT(uiReady()));
433 #endif
434  } else {
435  quit(); // Exit main loop
436  }
437 }
438 
440 {
441  LogPrintf("Shutdown result: %i\n", retval);
442  quit(); // Exit main loop after shutdown finished
443 }
444 
445 void BitcoinApplication::handleRunawayException(const QString &message)
446 {
447  QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + message);
448  ::exit(1);
449 }
450 
452 {
453  if (!window)
454  return 0;
455 
456  return window->winId();
457 }
458 
459 #ifndef BITCOIN_QT_TEST
460 int main(int argc, char *argv[])
461 {
463 
465  // Command-line options take precedence:
466  ParseParameters(argc, argv);
467 
468  // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
469 
471 #if QT_VERSION < 0x050000
472  // Internal string conversion is all UTF-8
473  QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
474  QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
475 #endif
476 
477  Q_INIT_RESOURCE(bitcoin);
478  GUIUtil::SubstituteFonts(); //0.9.3merge
479  BitcoinApplication app(argc, argv);
480 #if QT_VERSION > 0x050100
481  // Generate high-dpi pixmaps
482  QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
483 #endif
484 #ifdef Q_OS_MAC
485  QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
486 #endif
487 
488  // Register meta types used for QMetaObject::invokeMethod
489  qRegisterMetaType< bool* >();
490 
492  // must be set before OptionsModel is initialized or translations are loaded,
493  // as it is used to locate QSettings
494  QApplication::setOrganizationName(QAPP_ORG_NAME);
495  QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);
496  QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
497 
499  // Now that QSettings are accessible, initialize translations
500  QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator;
501  initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);
503 
504  // Show help message immediately after parsing command-line options (for "-lang") and setting locale,
505  // but before showing splash screen.
506  if (mapArgs.count("-?") || mapArgs.count("--help"))
507  {
508  HelpMessageDialog help(NULL);
509  help.showOrPrint();
510  return 1;
511  }
512 
514  // User language is set up: pick a data directory
516 
519  if (!boost::filesystem::is_directory(GetDataDir(false)))
520  {
521  QMessageBox::critical(0, QObject::tr("Bitcoin"),
522  QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
523  return 1;
524  }
525  try {
527  } catch(std::exception &e) {
528  QMessageBox::critical(0, QObject::tr("Bitcoin"),
529  QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
530  return false;
531  }
532 
534  // - Do not call Params() before this step
535  // - Do this after parsing the configuration file, as the network can be switched there
536  // - QSettings() will use the new application name after this, resulting in network-specific settings
537  // - Needs to be done before createOptionsModel
538 
539  // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
541  QMessageBox::critical(0, QObject::tr("Bitcoin"), QObject::tr("Error: Invalid combination of -regtest and -testnet."));
542  return 1;
543  }
544 #ifdef ENABLE_WALLET
545  // Parse URIs on command line -- this can affect Params()
546  if (!PaymentServer::ipcParseCommandLine(argc, argv))
547  exit(0);
548 #endif
549  bool isaTestNet = Params().NetworkID() != CChainParams::MAIN;
550  // Allow for separate UI settings for testnets
551  if (isaTestNet)
552  QApplication::setApplicationName(QAPP_APP_NAME_TESTNET);
553  else
554  QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
555  // Re-initialize translations after changing application name (language in network-specific settings can be different)
556  initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);
557 
558 #ifdef ENABLE_WALLET
559  // - Do this early as we don't want to bother initializing if we are just calling IPC
561  // - Do this *after* setting up the data directory, as the data directory hash is used in the name
562  // of the server.
563  // - Do this after creating app and setting up translations, so errors are
564  // translated properly.
566  exit(0);
567 
568  // Start up the payment server early, too, so impatient users that click on
569  // bitcoin: links repeatedly have their payment requests routed to this process:
570  app.createPaymentServer();
571 #endif
572 
574  // Install global event filter that makes sure that long tooltips can be word-wrapped
575  app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
576 #if QT_VERSION < 0x050000
577  // Install qDebug() message handler to route to debug.log
578  qInstallMsgHandler(DebugMessageHandler);
579 #else
580 #if defined(Q_OS_WIN)
581  // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)
582  qApp->installNativeEventFilter(new WinShutdownMonitor());
583 #endif
584  // Install qDebug() message handler to route to debug.log
585  qInstallMessageHandler(DebugMessageHandler);
586 #endif
587  // Load GUI settings from QSettings
588  app.createOptionsModel();
589 
590  // Subscribe to global signals from core
592 
593  if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false))
594  app.createSplashScreen(isaTestNet);
595 
597  string strWarningText = "This software is EXPERIMENTAL software for TESTNET TRANSACTIONS only. USE ON MAINNET AT YOUR OWN RISK.\n\n";
598  strWarningText += "The protocol and transaction processing rules for Mastercoin are still under active development and are subject to change in future.\n\n";
599  strWarningText += "Master Core should be considered an alpha-level product, and you use it at your own risk. Neither the Mastercoin Foundation nor the Master Core developers assumes any responsibility for funds misplaced, mishandled, lost, or misallocated.\n\n";
600  strWarningText += "Further, please note that this installation of Master Core should be viewed as EXPERIMENTAL. Your wallet data may be lost, deleted, or corrupted, with or without warning due to bugs or glitches. Please take caution.\n\n";
601  strWarningText += "This software is provided open-source at no cost. You are responsible for knowing the law in your country and determining if your use of this software contravenes any local laws.\n\n";
602  strWarningText += "DO NOT use wallet(s) with any significant amount of any property/currency while testing!";
603  QString warningText = QString::fromStdString(strWarningText);
604  QMessageBox warningDialog;
605  warningDialog.setIcon(QMessageBox::Warning);
606  warningDialog.setWindowTitle("WARNING - Experimental Software");
607  warningDialog.setText(warningText);
608  warningDialog.setStandardButtons(QMessageBox::No|QMessageBox::Yes);
609  warningDialog.setDefaultButton(QMessageBox::Yes);
610  warningDialog.setButtonText( QMessageBox::No, "Exit" );
611  warningDialog.setButtonText( QMessageBox::Yes, "Acknowledge + Continue" );
612  if(warningDialog.exec() == QMessageBox::No)
613  {
614  // exit, user does not agree to warning
615  qApp->quit();
616  }
617  else
618  {
619  try
620  {
621  app.createWindow(isaTestNet);
622  app.requestInitialize();
623  #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000
624  WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId());
625  #endif
626  app.exec();
627  app.requestShutdown();
628  app.exec();
629  }
630  catch (std::exception& e) {
631  PrintExceptionContinue(&e, "Runaway exception");
632  app.handleRunawayException(QString::fromStdString(strMiscWarning));
633  } catch (...) {
634  PrintExceptionContinue(NULL, "Runaway exception");
635  app.handleRunawayException(QString::fromStdString(strMiscWarning));
636  }
637  }
638  return app.getReturnValue();
639 }
640 #endif // BITCOIN_QT_TEST
OptionsModel * optionsModel
Definition: bitcoin.cpp:210
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
Definition: util.cpp:973
CClientUIInterface uiInterface
Definition: util.cpp:100
void createWindow(bool isaTestNet)
Create main window.
Definition: bitcoin.cpp:320
Value help(const Array &params, bool fHelp)
Definition: rpcserver.cpp:184
void shutdownResult(int retval)
Definition: bitcoin.cpp:439
string strMiscWarning
Definition: util.cpp:96
class for the splashscreen with information of the running client
Definition: splashscreen.h:12
Class encapsulating Bitcoin Core startup and shutdown.
Definition: bitcoin.cpp:144
BitcoinApplication(int &argc, char **argv)
Definition: bitcoin.cpp:274
void handleRunawayException(const QString &message)
Handle runaway exceptions. Shows a message box with the problem and quits the program.
Definition: bitcoin.cpp:445
int main(int argc, char *argv[])
Definition: bitcoin.cpp:460
void requestInitialize()
Request core initialization.
Definition: bitcoin.cpp:356
bool SelectParamsFromCommandLine()
Looks for -regtest or -testnet and then calls SelectParams as appropriate.
STL namespace.
Bitcoin GUI main class.
Definition: bitcoingui.h:35
static void showShutdownWindow(BitcoinGUI *window)
"Shutdown" window
void requestedInitialize()
static bool ipcParseCommandLine(int argc, char *argv[])
static bool ipcSendCommandLine()
static void InitMessage(const std::string &message)
Definition: bitcoin.cpp:66
void setClientModel(ClientModel *clientModel)
Set the client model.
Definition: bitcoingui.cpp:403
void shutdown()
Definition: bitcoin.cpp:257
void shutdownResult(int retval)
void SubstituteFonts()
Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text repre...
Definition: guiutil.cpp:382
#define QAPP_ORG_NAME
Definition: guiconstants.h:44
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
Definition: util.cpp:519
#define LogPrintf(...)
Definition: util.h:117
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: ui_interface.h:81
static int LogPrint(const char *category, const char *format)
Definition: util.h:143
Main Bitcoin application object.
Definition: bitcoin.cpp:167
void createSplashScreen(bool isaTestNet)
Create splash screen.
Definition: bitcoin.cpp:329
int getReturnValue()
Get process return value.
Definition: bitcoin.cpp:191
bool AppInit2(boost::thread_group &threadGroup)
Initialize bitcoin.
Definition: init.cpp:416
void Shutdown()
Definition: init.cpp:110
static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator)
Set up translations.
Definition: bitcoin.cpp:80
void splashFinished(QWidget *window)
void initializeResult(int retval)
WId getMainWinId() const
Get window identifier of QMainWindow (BitcoinGUI)
Definition: bitcoin.cpp:451
static std::string Translate(const char *psz)
Definition: bitcoin.cpp:74
void PrintExceptionContinue(std::exception *pex, const char *pszThread)
Definition: util.cpp:933
void initialize()
Definition: bitcoin.cpp:236
void ParseParameters(int argc, const char *const argv[])
Definition: util.cpp:460
Model for Bitcoin network client.
Definition: clientmodel.h:36
void DebugMessageHandler(QtMsgType type, const char *msg)
Definition: bitcoin.cpp:127
BitcoinGUI * window
Definition: bitcoin.cpp:212
void requestShutdown()
Request core shutdown.
Definition: bitcoin.cpp:362
QThread * coreThread
Definition: bitcoin.cpp:209
void createOptionsModel()
Create options model.
Definition: bitcoin.cpp:315
void initializeResult(int retval)
Definition: bitcoin.cpp:384
#define QAPP_APP_NAME_DEFAULT
Definition: guiconstants.h:46
#define ENABLE_WALLET
void ReadConfigFile(map< string, string > &mapSettingsRet, map< string, vector< string > > &mapMultiSettingsRet)
Definition: util.cpp:1019
static const int TOOLTIP_WRAP_THRESHOLD
Definition: guiconstants.h:30
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:20
#define QAPP_ORG_DOMAIN
Definition: guiconstants.h:45
const CChainParams & Params()
Return the currently selected parameters.
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:96
static void pickDataDirectory()
Determine data directory.
Definition: intro.cpp:152
#define QAPP_APP_NAME_TESTNET
Definition: guiconstants.h:47
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:100
"Help message" dialog box
Definition: utilitydialog.h:38
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
Definition: util.cpp:505
void SetupEnvironment()
Definition: util.cpp:1412
static void LoadRootCAs(X509_STORE *store=NULL)
map< string, vector< string > > mapMultiArgs
Definition: util.cpp:90
void runawayException(const QString &message)
boost::thread_group threadGroup
Definition: bitcoin.cpp:160
virtual Network NetworkID() const =0
ClientModel * clientModel
Definition: bitcoin.cpp:211
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:78
CWallet * pwalletMain
map< string, string > mapArgs
Definition: util.cpp:89
void handleRunawayException(std::exception *e)
Pass fatal exception message to UI thread.
Definition: bitcoin.cpp:230
QTimer * pollShutdownTimer
Definition: bitcoin.cpp:213
void StartDummyRPCThread()
Definition: rpcserver.cpp:651