Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: nathan_24 on February 15, 2016, 01:18:03 PM



Title: The timestamp of the block 57060 is lower than the median of the prev 11 blocks
Post by: nathan_24 on February 15, 2016, 01:18:03 PM
I was reading the developer reference and I found this:

Quote
The block time is a Unix epoch time when the miner started hashing the header (according to the miner). Must be greater than or equal to the median time of the previous 11 blocks. Full nodes will not accept blocks with headers more than two hours in the future according to their clock.

It's nice to have that rule in the protocol because otherwise miners could set any timestamp in the past. But I don't understand how is it possible that the block 57060 doesn't follow that rule. As you can see (https://blockchain.info/block-index/71910/0000000013048beeeb9f69cc957f627dfea0a5b5d1b900a6c7afa99e7c8f3336), it has a timestamp of more than one hour before the previous block. That shouldn't be a problem if the timestamp was still greater or equal the median of the previous eleven, but it turns out it is not.

The median of the blocks [57049-57059] is 1274556410.5454545, and thats +797 seconds ahead of the timestamp of the block 57060.

How is this possible?

Code:
Height  Timestamp
57049 1274553925
57050 1274554547
57051 1274554591
57052 1274554864
57053 1274555612
57054 1274555564
57055 1274556515
57056 1274557815
57057 1274558735
57058 1274558865
57059 1274559483
57060 1274555613


Title: Re: The timestamp of the block 57060 is lower than the median of the prev 11 blocks
Post by: Foxpup on February 15, 2016, 01:29:44 PM
1274556410.54 is the mean (https://en.wikipedia.org/wiki/Arithmetic_mean), not the median (https://en.wikipedia.org/wiki/Median). The median is 1274555612, which is less than 1274555613.


Title: Re: The timestamp of the block 57060 is lower than the median of the prev 11 blocks
Post by: nathan_24 on February 15, 2016, 01:47:21 PM
Thanks bud <3