diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-04-10 15:45:49 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-04-10 15:53:40 +0200 |
commit | 4881353efef81acc6ddbaaecd4ba89f012b3e87e (patch) | |
tree | d9b58f483d4eda76c889bf9f72c81f0a564b27cc /src/qt/clientmodel.cpp | |
parent | 1258dde48d255f18af928b7c59c4e78394f76de6 (diff) |
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.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index c17c602b50..e8d99a8d45 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 |