Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ldrapeau on April 22, 2024, 05:43:20 PM



Title: Possible bug on the bitcoin blockchain? Weird - please explain
Post by: ldrapeau on April 22, 2024, 05:43:20 PM
I just don't get it, maybe I don't understand the blockchain correctly, how can block 839972 and block 839973 have a time earlier than block 839971?  Thanks, if someone could explain, best, Louis




Code:
bitcoin@bitcoin:~$ for block in {839968..839975}; do echo $block: $(bitcoin-cli getblock $(bitcoin-cli getblockhash $block) 2 | ./jq ".time"); done
839968: 1713555843
839969: 1713556158
839970: 1713556364
839971: 1713558153
839972: 1713558054
839973: 1713558091
839974: 1713558976
839975: 1713559220
bitcoin@bitcoin:~$


Title: Re: Possible bug on the bitcoin blockchain? Weird - please explain
Post by: bipshuffle on April 22, 2024, 06:12:33 PM
See: https://en.bitcoin.it/wiki/Block_timestamp

Timestamps only need to satisfy the following:
"A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you. As a result block timestamps are not exactly accurate, and they do not need to be. Block times are accurate only to within an hour or two."


Title: Re: Possible bug on the bitcoin blockchain? Weird - please explain
Post by: ldrapeau on April 22, 2024, 07:55:53 PM
Ok, I see, many thanks for the explanation.  Does make sense, regards, Louis


Title: Re: Possible bug on the bitcoin blockchain? Weird - please explain
Post by: Bitcoin_Arena on April 22, 2024, 10:35:41 PM
I also had a similar question sometime back, so this thread[1] might also be worth looking in to for any one looking for further answers. Some members there gave some excellent responses.
1. What is with these Bitcoin blocks? (https://bitcointalk.org/index.php?topic=5482490)