Title: What clock is used by bitcoin? Post by: wingding on April 16, 2014, 06:21:53 PM I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used?
Title: Re: What clock is used by bitcoin? Post by: DubFX on April 16, 2014, 06:25:53 PM I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used? Here you go:https://en.bitcoin.it/wiki/DifficultyTitle: Re: What clock is used by bitcoin? Post by: TierNolan on April 16, 2014, 06:31:25 PM I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used? Each miner determines his own clock. There are 2 "clocks" actually. - the miner's system clock - the median of the timestamp when peers connect At least one of the first five peers you connect to must have a clock within 5 minutes of your computer or it displays a warning to fix your system clock. If the median of the other peers is within 70 minutes, it uses that time as your time. This (https://github.com/bitcoin/bitcoin/blob/master/src/util.cpp#L1259) is the code. Each miner decides what timestamp to add to its block. It can set it to anything but if it is more than 2 hours in the future, the block will not be accepted. If it is to far in the past, it will also not be accepted. A block's timestamp must be later than then median time of the 11 blocks before the block. This gives a short time window of acceptable times. Title: Re: What clock is used by bitcoin? Post by: wingding on April 16, 2014, 07:14:02 PM Thanks TierNolan!
|