progressDelta may be 0 (or even negative according to 11265), this checks for that and prints unknown if it is, because we cannot calculate an estimate for the time remaining (would be infinite or negative).
qt: Fixing division by zero in time remaining #11237
pull meshcollider wants to merge 2 commits into bitcoin:master from meshcollider:201709_fix_estimated_time changing 1 files +14 −12-
meshcollider commented at 9:28 am on September 5, 2017: contributor
-
fanquake added the label GUI on Sep 5, 2017
-
jonasschnelli commented at 7:52 pm on September 5, 2017: contributorutACK a676f81148cfcf57ea27effb3b69aef78b497994
-
MarcoFalke renamed this:
Fixing division by zero in time remaining
qt: Fixing division by zero in time remaining
on Sep 5, 2017 -
MarcoFalke commented at 9:42 pm on September 5, 2017: memberutACK a676f81
-
Fix division by zero in time remaining 3b69a08c53
-
Refactor tipUpdate as per style guide c8d38abd65
-
in src/qt/modaloverlay.cpp:98 in a676f81148 outdated
101- progressDelta = progressStart-sample.second; 102+ progressDelta = blockProcessTime[0].second - sample.second; 103 timeDelta = blockProcessTime[0].first - sample.first; 104- progressPerHour = progressDelta/(double)timeDelta*1000*3600; 105- remainingMSecs = remainingProgress / progressDelta * timeDelta; 106+ progressPerHour = progressDelta / (double) timeDelta * 1000 * 3600;
laanwj commented at 9:55 pm on September 5, 2017:Please don’t combine refactoring (code style fixups) and a bugfix in one commit. This makes it extremely hard to review what is changed. If you want to do this in one PR, that’s okay, but please do it as two separate commits.meshcollider commented at 10:52 pm on September 5, 2017: contributorSplit into 2 commits, thanks @laanwjin src/qt/modaloverlay.cpp:109 in 3b69a08c53 outdated
105 } 106 } 107 // show progress increase per hour 108 ui->progressIncreasePerH->setText(QString::number(progressPerHour*100, 'f', 2)+"%"); 109 110- // show expected remaining time
laanwj commented at 5:04 pm on September 6, 2017:Did you remove this comment intentionally? Edit: oh! it’s re-added in the commit after this. That’s a bit strange :)
meshcollider commented at 10:16 pm on September 6, 2017:Ah must have just been a bad commit split, sorry about thatlaanwj assigned laanwj on Sep 6, 2017laanwj merged this on Sep 7, 2017laanwj closed this on Sep 7, 2017
laanwj referenced this in commit e7f125562f on Sep 7, 2017codablock referenced this in commit 1f1a609708 on Sep 11, 2017UdjinM6 referenced this in commit 91d99fcd3f on Sep 11, 2017meshcollider deleted the branch on Sep 14, 2017MarcoFalke referenced this in commit 2e31b1d48d on Oct 3, 2017DrahtBot locked this on Sep 8, 2021
meshcollider jonasschnelli MarcoFalke laanwjLabels
GUI
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me