Skip to content

Commit 1bcabe6

Browse files
author
MarcoFalke
committed
Merge #697: Remove reindex special case from the progress bar label
faff2ba Remove reindex special case from the progress bar label (MarcoFalke) Pull request description: The user knows which option they passed to the program, so it seems overly verbose to offer the user feedback whether or not they passed `-reindex`. Treat it as `DISK`, like all other cases that are treated as `DISK`: * `-reindex-chainstate` * `-loadblock` ACKs for top commit: john-moffett: Re-ACK faff2ba hebasto: ACK faff2ba, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 7f110c4beb1451d26f32da3a60150dac91c8a7b8d1c01749017204712b73cc1b77578af492930e4b6704097a73ed051f77bc39d8f60e0ff15a797a201805312e
2 parents fe86616 + faff2ba commit 1bcabe6

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

src/interfaces/node.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,8 @@ class Node
177177
//! Is initial block download.
178178
virtual bool isInitialBlockDownload() = 0;
179179

180-
//! Get reindex.
181-
virtual bool getReindex() = 0;
182-
183-
//! Get importing.
184-
virtual bool getImporting() = 0;
180+
//! Is loading blocks.
181+
virtual bool isLoadingBlocks() = 0;
185182

186183
//! Set network active.
187184
virtual void setNetworkActive(bool active) = 0;

src/node/interfaces.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ class NodeImpl : public Node
295295
bool isInitialBlockDownload() override {
296296
return chainman().ActiveChainstate().IsInitialBlockDownload();
297297
}
298-
bool getReindex() override { return node::fReindex; }
299-
bool getImporting() override { return node::fImporting; }
298+
bool isLoadingBlocks() override { return node::fReindex || node::fImporting; }
300299
void setNetworkActive(bool active) override
301300
{
302301
if (m_context->connman) {

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
10711071
statusBar()->clearMessage();
10721072

10731073
// Acquire current block source
1074-
enum BlockSource blockSource = clientModel->getBlockSource();
1074+
BlockSource blockSource{clientModel->getBlockSource()};
10751075
switch (blockSource) {
10761076
case BlockSource::NETWORK:
10771077
if (synctype == SyncType::HEADER_PRESYNC) {
@@ -1091,9 +1091,6 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
10911091
progressBarLabel->setText(tr("Processing blocks on disk…"));
10921092
}
10931093
break;
1094-
case BlockSource::REINDEX:
1095-
progressBarLabel->setText(tr("Reindexing blocks on disk…"));
1096-
break;
10971094
case BlockSource::NONE:
10981095
if (synctype != SyncType::BLOCK_SYNC) {
10991096
return;

src/qt/clientmodel.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,10 @@ uint256 ClientModel::getBestBlockHash()
146146
return m_cached_tip_blocks;
147147
}
148148

149-
enum BlockSource ClientModel::getBlockSource() const
149+
BlockSource ClientModel::getBlockSource() const
150150
{
151-
if (m_node.getReindex())
152-
return BlockSource::REINDEX;
153-
else if (m_node.getImporting())
154-
return BlockSource::DISK;
155-
else if (getNumConnections() > 0)
156-
return BlockSource::NETWORK;
157-
151+
if (m_node.isLoadingBlocks()) return BlockSource::DISK;
152+
if (getNumConnections() > 0) return BlockSource::NETWORK;
158153
return BlockSource::NONE;
159154
}
160155

src/qt/clientmodel.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ QT_END_NAMESPACE
3232

3333
enum class BlockSource {
3434
NONE,
35-
REINDEX,
3635
DISK,
37-
NETWORK
36+
NETWORK,
3837
};
3938

4039
enum class SyncType {
@@ -72,8 +71,8 @@ class ClientModel : public QObject
7271
int getHeaderTipHeight() const;
7372
int64_t getHeaderTipTime() const;
7473

75-
//! Returns enum BlockSource of the current importing/syncing state
76-
enum BlockSource getBlockSource() const;
74+
//! Returns the block source of the current importing/syncing state
75+
BlockSource getBlockSource() const;
7776
//! Return warnings to be displayed in status bar
7877
QString getStatusBarWarnings() const;
7978

0 commit comments

Comments
 (0)