mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
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)
This commit is contained in:
commit
7b1bfa3a87
@ -3006,9 +3006,8 @@ static void NotifyHeaderTip() {
|
|||||||
CBlockIndex* pindexHeader = NULL;
|
CBlockIndex* pindexHeader = NULL;
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
if (!setBlockIndexCandidates.empty()) {
|
pindexHeader = pindexBestHeader;
|
||||||
pindexHeader = *setBlockIndexCandidates.rbegin();
|
|
||||||
}
|
|
||||||
if (pindexHeader != pindexHeaderOld) {
|
if (pindexHeader != pindexHeaderOld) {
|
||||||
fNotify = true;
|
fNotify = true;
|
||||||
fInitialBlockDownload = IsInitialBlockDownload();
|
fInitialBlockDownload = IsInitialBlockDownload();
|
||||||
|
@ -717,13 +717,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
|||||||
{
|
{
|
||||||
if (modalOverlay)
|
if (modalOverlay)
|
||||||
{
|
{
|
||||||
if (header) {
|
if (header)
|
||||||
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
|
modalOverlay->setKnownBestHeight(count, blockDate);
|
||||||
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
|
else
|
||||||
}
|
|
||||||
else {
|
|
||||||
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
|
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!clientModel)
|
if (!clientModel)
|
||||||
return;
|
return;
|
||||||
|
@ -219,7 +219,7 @@ QLabel { color: rgb(40,40,40); }</string>
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="numberOfBlocksLeft">
|
<widget class="QLabel" name="numberOfBlocksLeft">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>unknown...</string>
|
<string>Unknown...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -245,7 +245,7 @@ QLabel { color: rgb(40,40,40); }</string>
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>unknown...</string>
|
<string>Unknown...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -132,7 +132,8 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
|||||||
if (estimateNumHeadersLeft < 24 && hasBestHeader) {
|
if (estimateNumHeadersLeft < 24 && hasBestHeader) {
|
||||||
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count));
|
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count));
|
||||||
} else {
|
} else {
|
||||||
ui->expectedTimeLeft->setText(tr("Unknown. Syncing Headers..."));
|
ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight));
|
||||||
|
ui->expectedTimeLeft->setText(tr("Unknown..."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user