Move external block import to separate thread
This commit is contained in:
@@ -473,7 +473,7 @@ void BitcoinGUI::setNumConnections(int count)
|
||||
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
|
||||
{
|
||||
// don't show / hide progress bar and its label if we have no connection to the network
|
||||
if (!clientModel || clientModel->getNumConnections() == 0)
|
||||
if (!clientModel || (clientModel->getNumConnections() == 0 && !clientModel->isImporting()))
|
||||
{
|
||||
progressBarLabel->setVisible(false);
|
||||
progressBar->setVisible(false);
|
||||
@@ -491,7 +491,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
|
||||
|
||||
if (strStatusBarWarnings.isEmpty())
|
||||
{
|
||||
progressBarLabel->setText(tr("Synchronizing with network..."));
|
||||
progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network..."));
|
||||
progressBarLabel->setVisible(true);
|
||||
progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks));
|
||||
progressBar->setMaximum(nTotalBlocks);
|
||||
|
||||
@@ -103,6 +103,11 @@ bool ClientModel::inInitialBlockDownload() const
|
||||
return IsInitialBlockDownload();
|
||||
}
|
||||
|
||||
bool ClientModel::isImporting() const
|
||||
{
|
||||
return fImporting;
|
||||
}
|
||||
|
||||
int ClientModel::getNumBlocksOfPeers() const
|
||||
{
|
||||
return GetNumBlocksOfPeers();
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
bool isTestNet() const;
|
||||
//! Return true if core is doing initial block download
|
||||
bool inInitialBlockDownload() const;
|
||||
//! Return true if core is importing blocks
|
||||
bool isImporting() const;
|
||||
//! Return conservative estimate of total number of blocks, or 0 if unknown
|
||||
int getNumBlocksOfPeers() const;
|
||||
//! Return warnings to be displayed in status bar
|
||||
|
||||
Reference in New Issue
Block a user