aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-02-10 19:46:42 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2013-02-16 14:51:00 +0100
commit9f2467ad6241ce6cf0897ed30c676598d59441a7 (patch)
tree88f4a58c49b2982ce57098f2e30cd860a2ea352a /src/qt
parent24cde0b7d1ad014ffca5d0af896bc50b30e5ddcd (diff)
Transactions-based verification progress
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.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 635e0cb34b..16bc0a47de 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -572,8 +572,8 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
progressBarLabel->setText(importText);
progressBarLabel->setVisible(true);
progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
- progressBar->setMaximum(totalSecs);
- progressBar->setValue(totalSecs - secs);
+ progressBar->setMaximum(1000000000);
+ progressBar->setValue(clientModel->getVerificationProgress() * 1000000000.0 + 0.5);
progressBar->setVisible(true);
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 5f3368c30a..858fbe241f 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -6,6 +6,7 @@
#include "alert.h"
#include "main.h"
+#include "checkpoints.h"
#include "ui_interface.h"
#include <QDateTime>
@@ -54,6 +55,10 @@ QDateTime ClientModel::getLastBlockDate() const
return QDateTime::fromTime_t(1231006505); // Genesis block's time
}
+double ClientModel::getVerificationProgress() const
+{
+ return Checkpoints::GuessVerificationProgress(pindexBest);
+}
void ClientModel::updateTimer()
{
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 1afccb7859..a3fe92048c 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -34,6 +34,7 @@ public:
int getNumBlocks() const;
int getNumBlocksAtStartup();
+ double getVerificationProgress() const;
QDateTime getLastBlockDate() const;
//! Return true if client connected to testnet