mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
qt: prevent negative values of progressPerHour
Added a similar guard to progressPerHour as is placed at remainingMSecs. It prevents the display of negative values like "-0.00%" in some cases.
This commit is contained in:
parent
5dd28e5cff
commit
71d33380ed
@ -108,7 +108,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||
if (sample.first < (currentDate.toMSecsSinceEpoch() - 500 * 1000) || i == blockProcessTime.size() - 1) {
|
||||
progressDelta = blockProcessTime[0].second - sample.second;
|
||||
timeDelta = blockProcessTime[0].first - sample.first;
|
||||
progressPerHour = progressDelta / (double) timeDelta * 1000 * 3600;
|
||||
progressPerHour = (progressDelta > 0) ? progressDelta / (double)timeDelta * 1000 * 3600 : 0;
|
||||
remainingMSecs = (progressDelta > 0) ? remainingProgress / progressDelta * timeDelta : -1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user