Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1251}1252prevBlocks = count;1254#ifdef ENABLE_WALLET1255if(walletFrame)1256{1257walletFrame->showOutOfSyncWarning(true);1258modalOverlay->showHide();1259}1260#endif // ENABLE_WALLET1262tooltip += QString("<br>");1263tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);1264tooltip += QString("<br>");1265tooltip += tr("Transactions after this will not yet be visible.");1266}1268// Don't word-wrap this (fixed-width) tooltip1269tooltip = QString("<nobr>") + tooltip + QString("</nobr>");1271labelBlocksIcon->setToolTip(tooltip);1272progressBarLabel->setToolTip(tooltip);1273progressBar->setToolTip(tooltip);1274}1276void BitcoinGUI::createWallet()1277{1278#ifdef ENABLE_WALLET1279auto activity = new CreateWalletActivity(getWalletController(), this);1280connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);1281connect(activity, &CreateWalletActivity::created, rpcConsole, &RPCConsole::setCurrentWallet);1282activity->create();1283#endif // ENABLE_WALLET1284}1286void BitcoinGUI::message(const QString& title, QString message, unsigned int style, bool* ret, const QString& detailed_message)1287{1288// Default title. On macOS, the window title is ignored (as required by the macOS Guidelines).1289QString strTitle{CLIENT_NAME};1290// Default to information icon1291int nMBoxIcon = QMessageBox::Information;1292int nNotifyIcon = Notificator::Information;1294QString msgType;1295if (!title.isEmpty()) {1296msgType = title;1297} else {1298switch (style) {1299case CClientUIInterface::MSG_ERROR:1300msgType = tr("Error");1301message = tr("Error: %1").arg(message);1302break;1303case CClientUIInterface::MSG_WARNING:1304msgType = tr("Warning");1305message = tr("Warning: %1").arg(message);1306break;1307case CClientUIInterface::MSG_INFORMATION:1308msgType = tr("Information");1309// No need to prepend the prefix here.1310break;1311default:1312break;1313}1314}1316if (!msgType.isEmpty()) {1317strTitle += " - " + msgType;1318}1320if (style & CClientUIInterface::ICON_ERROR) {1321nMBoxIcon = QMessageBox::Critical;1322nNotifyIcon = Notificator::Critical;1323} else if (style & CClientUIInterface::ICON_WARNING) {1324nMBoxIcon = QMessageBox::Warning;1325nNotifyIcon = Notificator::Warning;1326}1328if (style & CClientUIInterface::MODAL) {1329// Check for buttons, use OK as default, if none was supplied1330QMessageBox::StandardButton buttons;1331if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))1332buttons = QMessageBox::Ok;1334showNormalIfMinimized();1335QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this);1336mBox.setTextFormat(Qt::PlainText);1337mBox.setDetailedText(detailed_message);1338int r = mBox.exec();1339if (ret != nullptr)1340*ret = r == QMessageBox::Ok;1341} else {1342notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message);1343}1344}1346void BitcoinGUI::changeEvent(QEvent *e)1347{1348if (e->type() == QEvent::PaletteChange) {1349overviewAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/overview")));1350sendCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/send")));1351receiveCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/receiving_addresses")));1352historyAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/history")));1353}1355QMainWindow::changeEvent(e);1357#ifndef Q_OS_MACOS // Ignored on Mac1358if(e->type() == QEvent::WindowStateChange)1359{1360if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())1361{1362QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);1363if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())1364{1365QTimer::singleShot(0, this, &BitcoinGUI::hide);1366e->ignore();1367}1368else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())1369{1370QTimer::singleShot(0, this, &BitcoinGUI::show);1371e->ignore();1372}1373}1374}1375#endif1376}1378void BitcoinGUI::closeEvent(QCloseEvent *event)1379{1380#ifndef Q_OS_MACOS // Ignored on Mac1381if(clientModel && clientModel->getOptionsModel())1382{1383if(!clientModel->getOptionsModel()->getMinimizeOnClose())1384{1385// close rpcConsole in case it was open to make some space for the shutdown window1386rpcConsole->close();1388Q_EMIT quitRequested();1389}1390else1391{1392QMainWindow::showMinimized();1393event->ignore();1394}1395}1396#else1397QMainWindow::closeEvent(event);1398#endif1399}1401void BitcoinGUI::showEvent(QShowEvent *event)1402{1403// enable the debug window when the main window shows up1404openRPCConsoleAction->setEnabled(true);1405aboutAction->setEnabled(true);1406optionsAction->setEnabled(true);1407}1409#ifdef ENABLE_WALLET1410void BitcoinGUI::incomingTransaction(const QString& date, BitcoinUnit unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName)1411{1412// On new transaction, make an info balloon1413QString msg = tr("Date: %1\n").arg(date) +1414tr("Amount: %1\n").arg(BitcoinUnits::formatWithUnit(unit, amount, true));1415if (m_node.walletLoader().getWallets().size() > 1 && !walletName.isEmpty()) {1416msg += tr("Wallet: %1\n").arg(walletName);1417}1418msg += tr("Type: %1\n").arg(type);1419if (!label.isEmpty())1420msg += tr("Label: %1\n").arg(label);1421else if (!address.isEmpty())1422msg += tr("Address: %1\n").arg(address);1423message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"),1424msg, CClientUIInterface::MSG_INFORMATION);1425}1426#endif // ENABLE_WALLET1428void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)1429{1430// Accept only URIs1431if(event->mimeData()->hasUrls())1432event->acceptProposedAction();1433}1435void BitcoinGUI::dropEvent(QDropEvent *event)1436{1437if(event->mimeData()->hasUrls())1438{1439for (const QUrl &uri : event->mimeData()->urls())1440{1441Q_EMIT receivedURI(uri.toString());1442}1443}1444event->acceptProposedAction();1445}1447bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)1448{1449// Catch status tip events1450if (event->type() == QEvent::StatusTip)1451{1452// Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff1453if (progressBarLabel->isVisible() || progressBar->isVisible())1454return true;1455}1456return QMainWindow::eventFilter(object, event);1457}1459#ifdef ENABLE_WALLET1460bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)1461{1462// URI has to be valid1463if (walletFrame && walletFrame->handlePaymentRequest(recipient))1464{1465showNormalIfMinimized();1466gotoSendCoinsPage();1467return true;1468}1469return false;1470}1472void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled)1473{1474labelWalletHDStatusIcon->setThemedPixmap(privkeyDisabled ? QStringLiteral(":/icons/eye") : hdEnabled ? QStringLiteral(":/icons/hd_enabled") : QStringLiteral(":/icons/hd_disabled"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);1475labelWalletHDStatusIcon->setToolTip(privkeyDisabled ? tr("Private key <b>disabled</b>") : hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));1476labelWalletHDStatusIcon->show();1477}1479void BitcoinGUI::setEncryptionStatus(int status)1480{1481switch(status)1482{1483case WalletModel::NoKeys:1484labelWalletEncryptionIcon->hide();1485encryptWalletAction->setChecked(false);1486changePassphraseAction->setEnabled(false);1487encryptWalletAction->setEnabled(false);1488break;1489case WalletModel::Unencrypted:1490labelWalletEncryptionIcon->hide();1491encryptWalletAction->setChecked(false);1492changePassphraseAction->setEnabled(false);1493encryptWalletAction->setEnabled(true);1494break;1495case WalletModel::Unlocked:1496labelWalletEncryptionIcon->show();1497labelWalletEncryptionIcon->setThemedPixmap(QStringLiteral(":/icons/lock_open"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);1498labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));1499encryptWalletAction->setChecked(true);1500changePassphraseAction->setEnabled(true);
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.