aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-01-17 16:46:33 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-02-07 11:02:01 +0100
commitfaff2ba4f80fad5af63a31559fd4065e631a8166 (patch)
tree07ee4adfeb36c685a3d29822db9fba13cd962e50 /src
parent5a80086ec2c15d1cd269e8e354f48ee11e4531eb (diff)
downloadbitcoin-faff2ba4f80fad5af63a31559fd4065e631a8166.tar.xz
Remove reindex special case from the progress bar label
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/node.h7
-rw-r--r--src/node/interfaces.cpp3
-rw-r--r--src/qt/bitcoingui.cpp5
-rw-r--r--src/qt/clientmodel.cpp11
-rw-r--r--src/qt/clientmodel.h7
5 files changed, 10 insertions, 23 deletions
diff --git a/src/interfaces/node.h b/src/interfaces/node.h
index ce6c44e2bc..7e87d5a523 100644
--- a/src/interfaces/node.h
+++ b/src/interfaces/node.h
@@ -177,11 +177,8 @@ public:
//! Is initial block download.
virtual bool isInitialBlockDownload() = 0;
- //! Get reindex.
- virtual bool getReindex() = 0;
-
- //! Get importing.
- virtual bool getImporting() = 0;
+ //! Is loading blocks.
+ virtual bool isLoadingBlocks() = 0;
//! Set network active.
virtual void setNetworkActive(bool active) = 0;
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index eda359568f..9c2db5ff0c 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -295,8 +295,7 @@ public:
bool isInitialBlockDownload() override {
return chainman().ActiveChainstate().IsInitialBlockDownload();
}
- bool getReindex() override { return node::fReindex; }
- bool getImporting() override { return node::fImporting; }
+ bool isLoadingBlocks() override { return node::fReindex || node::fImporting; }
void setNetworkActive(bool active) override
{
if (m_context->connman) {
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index a7ffd367d7..928d0bd355 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -1071,7 +1071,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
statusBar()->clearMessage();
// Acquire current block source
- enum BlockSource blockSource = clientModel->getBlockSource();
+ BlockSource blockSource{clientModel->getBlockSource()};
switch (blockSource) {
case BlockSource::NETWORK:
if (synctype == SyncType::HEADER_PRESYNC) {
@@ -1091,9 +1091,6 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
progressBarLabel->setText(tr("Processing blocks on disk…"));
}
break;
- case BlockSource::REINDEX:
- progressBarLabel->setText(tr("Reindexing blocks on disk…"));
- break;
case BlockSource::NONE:
if (synctype != SyncType::BLOCK_SYNC) {
return;
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index c0d1a0e226..69ed5d3a90 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -146,15 +146,10 @@ uint256 ClientModel::getBestBlockHash()
return m_cached_tip_blocks;
}
-enum BlockSource ClientModel::getBlockSource() const
+BlockSource ClientModel::getBlockSource() const
{
- if (m_node.getReindex())
- return BlockSource::REINDEX;
- else if (m_node.getImporting())
- return BlockSource::DISK;
- else if (getNumConnections() > 0)
- return BlockSource::NETWORK;
-
+ if (m_node.isLoadingBlocks()) return BlockSource::DISK;
+ if (getNumConnections() > 0) return BlockSource::NETWORK;
return BlockSource::NONE;
}
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 9ff64fe772..493e18a07d 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -32,9 +32,8 @@ QT_END_NAMESPACE
enum class BlockSource {
NONE,
- REINDEX,
DISK,
- NETWORK
+ NETWORK,
};
enum class SyncType {
@@ -72,8 +71,8 @@ public:
int getHeaderTipHeight() const;
int64_t getHeaderTipTime() const;
- //! Returns enum BlockSource of the current importing/syncing state
- enum BlockSource getBlockSource() const;
+ //! Returns the block source of the current importing/syncing state
+ BlockSource getBlockSource() const;
//! Return warnings to be displayed in status bar
QString getStatusBarWarnings() const;