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
  1. meshcollider commented at 9:28 am on September 5, 2017: contributor

    Fixes #10291, #11265

    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).

  2. fanquake added the label GUI on Sep 5, 2017
  3. jonasschnelli commented at 7:52 pm on September 5, 2017: contributor
    utACK a676f81148cfcf57ea27effb3b69aef78b497994
  4. MarcoFalke renamed this:
    Fixing division by zero in time remaining
    qt: Fixing division by zero in time remaining
    on Sep 5, 2017
  5. MarcoFalke commented at 9:42 pm on September 5, 2017: member
    utACK a676f81
  6. Fix division by zero in time remaining 3b69a08c53
  7. Refactor tipUpdate as per style guide c8d38abd65
  8. 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.
  9. meshcollider commented at 10:52 pm on September 5, 2017: contributor
    Split into 2 commits, thanks @laanwj
  10. in 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 that
  11. laanwj assigned laanwj on Sep 6, 2017
  12. laanwj merged this on Sep 7, 2017
  13. laanwj closed this on Sep 7, 2017

  14. laanwj referenced this in commit e7f125562f on Sep 7, 2017
  15. codablock referenced this in commit 1f1a609708 on Sep 11, 2017
  16. UdjinM6 referenced this in commit 91d99fcd3f on Sep 11, 2017
  17. meshcollider deleted the branch on Sep 14, 2017
  18. MarcoFalke referenced this in commit 2e31b1d48d on Oct 3, 2017
  19. DrahtBot locked this on Sep 8, 2021

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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me