From 4881353efef81acc6ddbaaecd4ba89f012b3e87e Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 10 Apr 2013 15:45:49 +0200 Subject: 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 --- src/qt/clientmodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/qt/clientmodel.cpp') 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 -- cgit v1.2.3