Move external block import to separate thread

This commit is contained in:
Pieter Wuille
2012-09-13 14:33:52 +02:00
parent 485d667748
commit 66b02c93e6
7 changed files with 70 additions and 27 deletions

View File

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