Bitcointalk

Difficulty

中本聪 · 2010 年 7 月 29 日

SN-1684 已核对来源,附原文与上下文。

阅读语言

你看错代码了。适用的是这段:

You were looking at the wrong code. Here's the code that applies:

bool CBlock::CheckBlock() const
{
...
    // Check timestamp
    if (nTime > GetAdjustedTime() + 2 * 60 * 60)
        return error("CheckBlock() : block timestamp too far in the future");
...

bool CBlock::AcceptBlock()
{
   ...
    // Check timestamp against prev
    if (nTime <= pindexPrev->GetMedianTimePast())
        return error("AcceptBlock() : block's timestamp is too early");

时间戳最多允许到未来 2 小时。它可以早于前一个区块,但必须大于最近 11 个区块的中位数。这样做的原因是:如果前一个区块的时间戳超前太多,就像刚才发生的那样,时间可以在下一个区块被纠正回来。

The timestamp is limited to up to 2 hours in the future. It can be earlier than the previous block, but it must be greater than the median of the last 11 blocks. The reason for doing it that way is so the time can get corrected in the next block if the previous block had the time too far in the future, like what happened.

上下文
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-1684

阅读字号

选择适合你的字号,之后阅读会继续使用。