MCPcopy Create free account
hub / github.com/ElementsProject/elements / setNumBlocks

Method setNumBlocks

src/qt/bitcoingui.cpp:989–1105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
990{
991// Disabling macOS App Nap on initial sync, disk and reindex operations.
992#ifdef Q_OS_MAC
993 if (sync_state == SynchronizationState::POST_INIT) {
994 m_app_nap_inhibitor->enableAppNap();
995 } else {
996 m_app_nap_inhibitor->disableAppNap();
997 }
998#endif
999
1000 if (modalOverlay)
1001 {
1002 if (header)
1003 modalOverlay->setKnownBestHeight(count, blockDate);
1004 else
1005 modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
1006 }
1007 if (!clientModel)
1008 return;
1009
1010 // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbled text)
1011 statusBar()->clearMessage();
1012
1013 // Acquire current block source
1014 enum BlockSource blockSource = clientModel->getBlockSource();
1015 switch (blockSource) {
1016 case BlockSource::NETWORK:
1017 if (header) {
1018 updateHeadersSyncProgressLabel();
1019 return;
1020 }
1021 progressBarLabel->setText(tr("Synchronizing with network…"));
1022 updateHeadersSyncProgressLabel();
1023 break;
1024 case BlockSource::DISK:
1025 if (header) {
1026 progressBarLabel->setText(tr("Indexing blocks on disk…"));
1027 } else {
1028 progressBarLabel->setText(tr("Processing blocks on disk…"));
1029 }
1030 break;
1031 case BlockSource::REINDEX:
1032 progressBarLabel->setText(tr("Reindexing blocks on disk…"));
1033 break;
1034 case BlockSource::NONE:
1035 if (header) {
1036 return;
1037 }
1038 progressBarLabel->setText(tr("Connecting to peers…"));
1039 break;
1040 }
1041
1042 QString tooltip;
1043
1044 QDateTime currentDate = QDateTime::currentDateTime();
1045 qint64 secs = blockDate.secsTo(currentDate);
1046

Callers

nothing calls this directly

Calls 9

formatNiceTimeOffsetFunction · 0.85
setKnownBestHeightMethod · 0.80
tipUpdateMethod · 0.80
getBlockSourceMethod · 0.80
setTextMethod · 0.80
setThemedPixmapMethod · 0.80
showHideMethod · 0.80
showOutOfSyncWarningMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected