Browse Source

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)
0.14
Jonas Schnelli 8 years ago
parent
commit
7b1bfa3a87
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC
  1. 5
      src/main.cpp
  2. 9
      src/qt/bitcoingui.cpp
  3. 4
      src/qt/forms/modaloverlay.ui
  4. 3
      src/qt/modaloverlay.cpp

5
src/main.cpp

@ -3006,9 +3006,8 @@ static void NotifyHeaderTip() { @@ -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();

9
src/qt/bitcoingui.cpp

@ -717,14 +717,11 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer @@ -717,14 +717,11 @@ 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;

4
src/qt/forms/modaloverlay.ui

@ -219,7 +219,7 @@ QLabel { color: rgb(40,40,40); }</string> @@ -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> @@ -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>

3
src/qt/modaloverlay.cpp

@ -132,7 +132,8 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri @@ -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..."));
}
}

Loading…
Cancel
Save