aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2021-05-24 16:02:57 +0200
committerGitHub <[email protected]>2021-05-24 16:02:57 +0200
commitc7206962bea2ec8a6b10cc1aa27f4541a6e05fc9 (patch)
tree61b0f281cd3af0d728b38fa1f4d74075384817ad /src
parentMerge pull request #1856 from chromatic/add-wif-import (diff)
parentSkip expected remaining sync time without estimate (diff)
downloaddiscoin-c7206962bea2ec8a6b10cc1aa27f4541a6e05fc9.tar.xz
discoin-c7206962bea2ec8a6b10cc1aa27f4541a6e05fc9.zip
Merge pull request #1908 from chromatic/sync-screen-negative-gh1902
Qt: Show only useful estimates on sync screen
Diffstat (limited to 'src')
-rw-r--r--src/qt/modaloverlay.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp
index bf632d28c..f3a28fc55 100644
--- a/src/qt/modaloverlay.cpp
+++ b/src/qt/modaloverlay.cpp
@@ -104,10 +104,11 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
}
}
// show progress increase per hour
- ui->progressIncreasePerH->setText(QString::number(progressPerHour*100, 'f', 2)+"%");
+ ui->progressIncreasePerH->setText(QString::number(progressPerHour > 0 ? progressPerHour*100 : 0, 'f', 2)+"%");
- // show expected remaining time
- ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs/1000.0));
+ // show expected remaining time, if we have a sample
+ if (remainingMSecs > 0)
+ ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs/1000.0));
static const int MAX_SAMPLES = 5000;
if (blockProcessTime.count() > MAX_SAMPLES)
@@ -126,7 +127,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
return;
// estimate the number of headers left based on nPowTargetSpacing
- // and check if the gui is not aware of the the best header (happens rarely)
+ // and check if the GUI is not aware of the best header (happens rarely)
int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus(bestHeaderHeight).nPowTargetSpacing;
bool hasBestHeader = bestHeaderHeight >= count;