aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-10-21 14:29:54 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-10-21 14:30:02 +0200
commit7b1bfa3a8786f0c154d9def003ab1b42f09fe717 (patch)
tree4cd7b54b5bc44124382fc8fbc0ac72e6bcc2e073 /src
parent0e228557f239d8e43bf94b19b3a96240e7a75359 (diff)
parent3154d6e3a207812578cb37a505f140b46b17c945 (diff)
Merge #8985: Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip()
3154d6e [Qt] use NotifyHeaderTip's height and date for the progress update (Jonas Schnelli) 0a261b6 Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip() (Jonas Schnelli)
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp5
-rw-r--r--src/qt/bitcoingui.cpp9
-rw-r--r--src/qt/forms/modaloverlay.ui4
-rw-r--r--src/qt/modaloverlay.cpp3
4 files changed, 9 insertions, 12 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 50158b4687..8c95f36db2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3006,9 +3006,8 @@ static void NotifyHeaderTip() {
CBlockIndex* pindexHeader = NULL;
{
LOCK(cs_main);
- if (!setBlockIndexCandidates.empty()) {
- pindexHeader = *setBlockIndexCandidates.rbegin();
- }
+ pindexHeader = pindexBestHeader;
+
if (pindexHeader != pindexHeaderOld) {
fNotify = true;
fInitialBlockDownload = IsInitialBlockDownload();
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index af767aa6c6..ee5102c4f9 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -717,13 +717,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
{
if (modalOverlay)
{
- if (header) {
- /* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
- modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
- }
- else {
+ if (header)
+ modalOverlay->setKnownBestHeight(count, blockDate);
+ else
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
- }
}
if (!clientModel)
return;
diff --git a/src/qt/forms/modaloverlay.ui b/src/qt/forms/modaloverlay.ui
index 73223735f5..27998f90c5 100644
--- a/src/qt/forms/modaloverlay.ui
+++ b/src/qt/forms/modaloverlay.ui
@@ -219,7 +219,7 @@ QLabel { color: rgb(40,40,40); }</string>
<item row="0" column="1">
<widget class="QLabel" name="numberOfBlocksLeft">
<property name="text">
- <string>unknown...</string>
+ <string>Unknown...</string>
</property>
</widget>
</item>
@@ -245,7 +245,7 @@ QLabel { color: rgb(40,40,40); }</string>
</sizepolicy>
</property>
<property name="text">
- <string>unknown...</string>
+ <string>Unknown...</string>
</property>
</widget>
</item>
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp
index ae0d8f5f63..1a843a07ac 100644
--- a/src/qt/modaloverlay.cpp
+++ b/src/qt/modaloverlay.cpp
@@ -132,7 +132,8 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
if (estimateNumHeadersLeft < 24 && hasBestHeader) {
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count));
} else {
- ui->expectedTimeLeft->setText(tr("Unknown. Syncing Headers..."));
+ ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight));
+ ui->expectedTimeLeft->setText(tr("Unknown..."));
}
}