Progress on log is more or less than 1.0 when it should be exactly 1.0 #3963

issue felipelalli opened this issue on March 26, 2014
  1. felipelalli commented at 6:43 AM on March 26, 2014: none

    The progress on log sometimes shows like 0.999971, 1.000001 or 1.000009 what is impossible, and should be 1.000000. This must be a precision error.

    I imagine this little bug does not affect the Bitcoin UI, only the log files.

    Where to modify:

    src/main.cpp - Line 1907 at 2b45345aaca9d0091972f983ac6e5c0b09d14777 LogPrintf("UpdateTip: ...");

    Related commit: 9f2467ad6241ce6cf0897ed30c676598d59441a7

    NOTE: This is a just slight improvement and very low priority.

  2. felipelalli referenced this in commit 9f2467ad62 on Mar 26, 2014
  3. laanwj added the label Priority Low on Mar 27, 2014
  4. laanwj commented at 8:29 AM on May 8, 2014: member

    I imagine that this is not a precision error, but simply an inability to know it for sure.

    The function is called GuessVerificationProgress which has 'Guess' in the name. It is never used for critical tasks, just for coarsely reporting progress.

  5. felipelalli commented at 6:07 PM on May 8, 2014: none

    Sure. But even guessing it is possible to know the number can't be bigger than 1.0, at least. But if it is only for the log and does not affect anything more, I guess this bug should not be fixed.

  6. paveljanik commented at 6:25 PM on November 30, 2014: contributor

    The method GuessVerificationProgress returns number bigger than 1 if the last known block's time is in the future compared to our system time (from time(NULL) - compare https://github.com/bitcoin/bitcoin/blob/master/src/checkpoints.cpp#L64). This can happen if our time is bad or if the received block comes with future time (which is perfectly valid as we accept blocks that can be 2 hours in the future based on the adjusted time - see https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L2366). In such cases, we are really "in the future"/ahead compared to our expectations. So number bigger than one is perfectly OK here. This issue can be closed.

  7. sipa commented at 6:27 PM on November 30, 2014: member

    We could 'fix' it by subtracting 2 hours from the clock first, but that would on average result in getting less close to 1.0.

  8. paveljanik commented at 7:16 PM on November 30, 2014: contributor

    Can we return 1.0 if the last block is in the future?

  9. TheBlueMatt commented at 7:55 PM on November 30, 2014: member

    I kind of like the 1.XXX, it counters the perception that 0.9999XX implies you aren't caught up, even though you are.

  10. paveljanik commented at 8:28 PM on November 30, 2014: contributor

    I do not think we have to fix the code - good explanation is enough IMO.

  11. laanwj commented at 8:15 AM on December 2, 2014: member

    Agreed. I don't think this needs to be fixed either. Closing.

  12. laanwj closed this on Dec 2, 2014

  13. 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-20 06:16 UTC

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