Show block timestamp #1304

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:ShowBlockTimestamp changing 2 files +13 −4
  1. rebroad commented at 6:45 PM on May 14, 2012: contributor

    Adds the block timestamp to the debug.log output. Can be useful when catching up and viewing the progress in debug.log to see how far behind on the blockchain the node is. Can also be interesting to see the duration between blocks, and sometimes even seeing the odd block that has timestamps earlier than previous blocks - which could indicate whether the network is attempting to be manipulated.

    This pull is a subset of pull #1311

  2. gmaxwell commented at 6:49 PM on May 14, 2012: contributor

    (Just for the benefit of people finding this pull request in google searches: Negative timestamps are not a sign of manipulation, nodes make no effort to avoid negative timestamps— they just use their accurate times. Ntimerolling by miners sometimes moves the time far ahead and then the next block gets the correct time at a time earlier than the prior one)

  3. rebroad commented at 6:56 PM on May 14, 2012: contributor

    @gmaxwell they aren't usually a sign of manipulation, but they could be a sign. This is correct, right? It's rare, admittedly, and might never have happened so far!

  4. gmaxwell commented at 6:59 PM on May 14, 2012: contributor

    @rebroad It's not an interesting form of manipulation (someone could lie to slightly increase the difficulty by a about half a percent), but I wasn't taking issue with your comment. There have been some people who saw the negative going timestamps and ran around claiming it was an attack, seems to be a common mistake people make in assuming that it won't happen absent an attack. Logging it sounds fine to me.

  5. Show the timestamp for the block.
    wrap lines
    e69a797990
  6. sipa commented at 7:39 PM on June 12, 2012: member

    ACK. I think it's still interesting to have these in debug.log, even if just as a way of keeping track of how far you are behind.

  7. Diapolo commented at 8:57 PM on June 12, 2012: none

    If you indent, can you please "always" use 4 spaces (4 spaces == 1 tab kind of)?

  8. rebroad commented at 4:31 PM on June 14, 2012: contributor

    @Diapolo I thought 4 spaces was for inside functions/parenthesis, and 2 spaces is for lines that have been broken up over more than one line.

  9. Diapolo commented at 4:35 PM on June 14, 2012: none

    I'm not sure abot that, it just looked weird to me.

  10. jgarzik referenced this in commit 6e3a1a3742 on Jul 5, 2012
  11. jgarzik merged this on Jul 5, 2012
  12. jgarzik closed this on Jul 5, 2012

  13. rebroad commented at 2:44 PM on September 1, 2012: contributor

    oooh.. it got merged. almost 3 months later. cool. thanks!

  14. nifgraup referenced this in commit b55d59d28f on Mar 30, 2014
  15. rebroad deleted the branch on Dec 4, 2016
  16. suprnurd referenced this in commit a73185d939 on Dec 5, 2017
  17. lateminer referenced this in commit 86890cdb5b on Jan 22, 2019
  18. 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-22 18:16 UTC

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