(serious) bug with wrong system clock #2007

issue Diapolo opened this issue on November 13, 2012
  1. Diapolo commented at 3:04 PM on November 13, 2012: none

    I set my computers date to 2012-07-13 and tried to start the client (current master) and during startup it simply crashes. This is from the debug.log:

    <pre> 07/13/12 13:56:32 ERROR: CheckBlock() : block timestamp too far in the future 07/13/12 13:56:32 LoadBlockIndex() : *** found bad block at 34105, hash=0000000037c57b5ff0ebedd38469b9797c89e8640cbcd52dc967d3805e487b51 07/13/12 13:56:32 ERROR: LoadBlockIndex(): chain database corrupted </pre>

    There should be a check and warning like the one in util.cpp - AddTimeData(), but this needs to be done from some core dev.

  2. Diapolo commented at 3:15 PM on November 14, 2012: none

    Did any other dev try this? Or am I the only one that can re-create that crash situation?

  3. Diapolo cross-referenced this on Nov 14, 2012 from issue GUI shows generic out of sync warning when the clock is wrong. by gmaxwell
  4. Diapolo commented at 2:52 PM on November 20, 2012: none

    @sipa Did you check this out? Does it happen also on Linux or with bitcoind?

  5. Azulan commented at 7:57 AM on November 26, 2012: none

    Would it be possible to make an NTP request to a one of a list of well known time servers to check for this kind of problem?

  6. laanwj commented at 11:38 AM on November 26, 2012: member

    This problem would be solved with a friendlier error message. Bailing out as early as possible is all we can do when the user's clock is detected to be wrong by this much.

    (p2p nodes already send their time so ntp is not needed, and relying on well known servers would be a big nono for a distributed protocol)

  7. Diapolo commented at 3:16 PM on November 26, 2012: none

    @laanwj I would prefer an error message before the client simply crashes, before we talk about how friedly that message should be :-D. Does a wrong time cause a crash on Linux, too with current master?

  8. Azulan commented at 12:00 AM on November 27, 2012: none

    I would suggest it as a client feature, not a part of the protocol.

    But you are right, the protocol does seem to provide for time services already. I apologize for the superfluous suggestion.

  9. Diapolo commented at 1:08 AM on January 26, 2013: none

    @sipa Any comment for this one?

  10. laanwj cross-referenced this on Nov 27, 2013 from issue ChainState DB uncorrupted itself by fanquake
  11. laanwj cross-referenced this on Nov 21, 2014 from issue Refine startup error messages (e.g. wrong system time) by dexX7
  12. casey cross-referenced this on Jul 28, 2015 from issue Give a better error message if system clock is bad by casey
  13. laanwj closed this on Aug 5, 2015

  14. laanwj cross-referenced this on Feb 16, 2016 from issue Clock-warped node gets quietly wedged by zw
  15. HashUnlimited referenced this in commit 8d01ab9dda on Mar 21, 2018
  16. KolbyML referenced this in commit a0d5b62e5b on Dec 5, 2020
  17. bitcoin 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-05-20 06:55 UTC