mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user