MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / initializeResult

Method initializeResult

src/qt/bitcoin.cpp:379–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info)
380{
381 qDebug() << __func__ << ": Initialization result: " << success;
382
383 if (!success || m_node->shutdownRequested()) {
384 requestShutdown();
385 return;
386 }
387
388 delete m_splash;
389 m_splash = nullptr;
390
391 // Log this only after AppInitMain finishes, as then logging setup is guaranteed complete
392 qInfo() << "Platform customization:" << platformStyle->getName();
393 clientModel = new ClientModel(node(), optionsModel);
394 window->setClientModel(clientModel, &tip_info);
395
396 // If '-min' option passed, start window minimized (iconified) or minimized to tray
397 bool start_minimized = gArgs.GetBoolArg("-min", false);
398#ifdef ENABLE_WALLET
399 if (WalletModel::isWalletEnabled()) {
400 m_wallet_controller = new WalletController(*clientModel, platformStyle, this);
401 window->setWalletController(m_wallet_controller, /*show_loading_minimized=*/start_minimized);
402 if (paymentServer) {
403 paymentServer->setOptionsModel(optionsModel);
404 }
405 }
406#endif // ENABLE_WALLET
407
408 // Show or minimize window
409 if (!start_minimized) {
410 window->show();
411 } else if (clientModel->getOptionsModel()->getMinimizeToTray() && window->hasTrayIcon()) {
412 // do nothing as the window is managed by the tray icon
413 } else {
414 window->showMinimized();
415 }
416 Q_EMIT windowShown(window);
417
418#ifdef ENABLE_WALLET
419 // Now that initialization/startup is done, process any command-line
420 // bitcoin: URIs or payment requests:
421 if (paymentServer) {
422 connect(paymentServer, &PaymentServer::receivedPaymentRequest, window, &BitcoinGUI::handlePaymentRequest);
423 connect(window, &BitcoinGUI::receivedURI, paymentServer, &PaymentServer::handleURIOrFile);
424 connect(paymentServer, &PaymentServer::message, [this](const QString& title, const QString& message, unsigned int style) {
425 window->message(title, message, style);
426 });
427 QTimer::singleShot(100ms, paymentServer, &PaymentServer::uiReady);
428 }
429#endif
430 pollShutdownTimer->start(SHUTDOWN_POLLING_DELAY);
431}
432
433void BitcoinApplication::handleRunawayException(const QString &message)
434{

Callers

nothing calls this directly

Calls 11

GetBoolArgMethod · 0.80
setWalletControllerMethod · 0.80
getMinimizeToTrayMethod · 0.80
hasTrayIconMethod · 0.80
shutdownRequestedMethod · 0.45
getNameMethod · 0.45
setClientModelMethod · 0.45
setOptionsModelMethod · 0.45
getOptionsModelMethod · 0.45
messageMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected