Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: qdoop on October 17, 2014, 05:46:40 AM



Title: Block timestamp must not be more than two hours in the future. What src file?
Post by: qdoop on October 17, 2014, 05:46:40 AM

Could some one help me locate where the following protocol rules are enforced in Bitcoin Core src.
What files should i read?

a) Block timestamp must not be more than two hours in the future.
b) Reject if timestamp is the median time of the last 11 blocks or before

PS. Perhaps the answer should be RTFM but I may miss something important.

Thanks in advance.


Title: Re: Block timestamp must not be more than two hours in the future. What src file?
Post by: Foxpup on October 17, 2014, 09:46:39 AM
a) is in the CheckBlockHeader() function (was CheckBlock() in older versions).
b) is in the AcceptBlockHeader() function (AcceptBlock() in older versions).
Both are defined in main.cpp.


Title: Re: Block timestamp must not be more than two hours in the future. What src file?
Post by: qdoop on October 17, 2014, 09:59:05 AM
Thanks a lot  ::)

Looked to other places and skipped the obvious!