aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <[email protected]>2013-04-10 15:45:49 +0200
committerPhilip Kaufmann <[email protected]>2013-04-10 15:53:40 +0200
commit4881353efef81acc6ddbaaecd4ba89f012b3e87e (patch)
treed9b58f483d4eda76c889bf9f72c81f0a564b27cc /src/qt/clientmodel.cpp
parentMerge pull request #2498 from jonasschnelli/addressbookpage_mac_fix (diff)
downloaddiscoin-4881353efef81acc6ddbaaecd4ba89f012b3e87e.tar.xz
discoin-4881353efef81acc6ddbaaecd4ba89f012b3e87e.zip
rework ClientModel::getBlockSource() + BitcoinGUI::setNumBlocks()
- updates ClientModel::getBlockSource() to return all available states and sorts enum BlockSource in order of usage cases (none default, then reindex, import and network) - updates BitcoinGUI::setNumBlocks() to better use getBlockSource() and also adds a message, when we have NO block source available
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index c17c602b5..e8d99a8d4 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -122,9 +122,12 @@ enum BlockSource ClientModel::getBlockSource() const
{
if (fReindex)
return BLOCK_SOURCE_REINDEX;
- if (fImporting)
+ else if (fImporting)
return BLOCK_SOURCE_DISK;
- return BLOCK_SOURCE_NETWORK;
+ else if (getNumConnections() > 0)
+ return BLOCK_SOURCE_NETWORK;
+
+ return BLOCK_SOURCE_NONE;
}
int ClientModel::getNumBlocksOfPeers() const