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
This commit is contained in:
Philip Kaufmann
2013-04-10 15:45:49 +02:00
parent 1258dde48d
commit 4881353efe
3 changed files with 23 additions and 26 deletions

View File

@@ -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