Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Forp on June 27, 2011, 12:13:45 AM



Title: Timestamps going backwards - why ?
Post by: Forp on June 27, 2011, 12:13:45 AM
Once in a while timestamps are moving backwards. :o

Block 32649 is from 09:49:06 and the next block 32650 is from the same day 2 hours earlier, 7:50:31.  :o

This is not the only example, there are quite many - and it is also not just 3 or 6 minutes but hours.

I am trying to understand that phenomenon - but I don't. even if there is a chain reorganization, the chains mut be built in sequence - and the code shoulod check linearity in time.

Where is my mistake?


Title: Re: Timestamps going backwards - why ?
Post by: kjj on June 27, 2011, 12:20:38 AM
The network doesn't require that a block be newer than the previous block, just that it be newer than the median time of the last several blocks.


Title: Re: Timestamps going backwards - why ?
Post by: MoonShadow on June 27, 2011, 12:23:58 AM

Where is my mistake?


There is no mistake, the timestamp is provided by the machine that submits the block.  The client permits a great deal of variation for the timestamp before it rejects it, because the only reason that it's in there at all is to determine the retarget value once every 2016 blocks, and it only needs to be so accurate.  It wouldn't be necessary to reject incorrect timestamps at all, if not for the possibility of manipulation of the retarget.


Title: Re: Timestamps going backwards - why ?
Post by: Forp on June 27, 2011, 08:44:07 AM
Thanx a lot - this was very helpful.

The bitcoin client is actually constructed in a very smart manner.  :)