aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoingui.cpp4
-rw-r--r--src/qt/clientmodel.cpp5
-rw-r--r--src/qt/clientmodel.h2
-rw-r--r--src/qt/transactiondesc.cpp6
4 files changed, 11 insertions, 6 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 19a6a65a1b..0d269ea210 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -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);
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index b820d16abf..990b364a94 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -103,6 +103,11 @@ bool ClientModel::inInitialBlockDownload() const
return IsInitialBlockDownload();
}
+bool ClientModel::isImporting() const
+{
+ return fImporting;
+}
+
int ClientModel::getNumBlocksOfPeers() const
{
return GetNumBlocksOfPeers();
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 70d816ba9d..926390a07a 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -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
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index efc77e190e..e358c12e96 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -234,8 +234,6 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
strHTML += "<br><b>" + tr("Transaction") + ":</b><br>";
strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true);
- CTxDB txdb("r"); // To fetch source txouts
-
strHTML += "<br><b>" + tr("Inputs") + ":</b>";
strHTML += "<ul>";
@@ -245,8 +243,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
{
COutPoint prevout = txin.prevout;
- CTransaction prev;
- if(txdb.ReadDiskTx(prevout.hash, prev))
+ CCoins prev;
+ if(pcoinsTip->GetCoins(prevout.hash, prev))
{
if (prevout.n < prev.vout.size())
{