add GetTotalBlocksEstimate() function, move magic number to constant #327

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:totalblocksestimate1 changing 2 files +17 −1
  1. laanwj commented at 7:50 PM on June 18, 2011: member

    For my Qt GUI, I display a progress bar on first start to keep track of how far the initial block chain download is.

    This needs a conservative estimate of the total blocks in the chain. Currently, one such estimate is hardcoded into IsInitialBlockDownload as a magic number.

    This patch moves the magic number to a constant, and adds a function GetTotalBlocksEstimate() to retrieve the value (always 0 for testnet).

    According to the forum topic https://forum.bitcoin.org/index.php?topic=17485.0 it would be possible to compute a real estimate based on version messages; this same interface could later be extended to return this.

  2. gavinandresen commented at 3:20 PM on June 24, 2011: contributor

    I approve this pull request.

  3. laanwj commented at 3:59 PM on June 25, 2011: member

    Changed nInitialBlockThreshold to 114 after discussion with sipa

  4. add GetTotalBlocksEstimate() function, move magic number to constant 32ea8b4c31
  5. TheBlueMatt commented at 1:28 AM on June 26, 2011: member

    Too late, gavin merged the old version in c774b1697690c3f94ccd79c5de660b6050ac6409, why is this still open?

  6. tcatm closed this on Jun 29, 2011

  7. laanwj deleted the branch on Apr 9, 2014
  8. dexX7 referenced this in commit ce45cc8cf8 on Jan 4, 2016
  9. yourhydra referenced this in commit 8769cf0467 on Mar 6, 2017
  10. destenson referenced this in commit aa1235aa07 on Nov 18, 2017
  11. destenson referenced this in commit 19dffdc820 on Nov 18, 2017
  12. attilaaf referenced this in commit fdd66b3719 on Jan 13, 2020
  13. rajarshimaitra referenced this in commit 80c88c4b26 on Aug 5, 2021
  14. 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: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me