mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Merge bitcoin-core/gui#508: Prevent negative values of progressPerHour
71d33380ed
qt: prevent negative values of progressPerHour (HiLivin) Pull request description: Added a similar guard to _progressPerHour_ as is placed at _remainingMSecs_. It prevents the display of negative values like "-0.00%" in some cases. ACKs for top commit: hebasto: ACK71d33380ed
jarolrod: ACK71d3338
shaavan: reACK71d33380ed
Tree-SHA512: 5427cdf4441b542196008034355ea00a075adf8b9aeeb383bacdb4e5fbda23d665448a50035aac93cbf401d5d6211d39a2c7c294568d9f5548a5c7579e201c44
This commit is contained in:
commit
b8cc75435a
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue