原始文献 / 论坛帖 / Re: [PATCH] Automatic block validation

Re: [PATCH] Automatic block validation

Bitcointalk · 2010-08-16 17:08:02 UTC

AuthorSatoshi Nakamoto
TitleRe: [PATCH] Automatic block validation
Date2010-08-16 17:08:02 UTC
ForumBitcointalk · 原文

引用自:satoshi,2010 年 8 月 16 日 03:25:54 PM(https://bitcointalk.org/index.php?topic=832.msg9754#msg9754)

在检查完直接调 AddToBlockIndex 或 Reorganize 大概也行,但要小心得多。我大概会把 AddToBlockIndex 里设新 best block 的部分拆出来,用那个办法,而不是下面这段代码。

SVN rev 139 里我就是这么干的。

我没删坏链,而是在 ConnectBlock 里多加了一次 CheckBlock,坏块被踢出去后就再也回不到 best chain。

英文原文

Quote from: satoshi on August 16, 2010, 03:25:54 PM(https://bitcointalk.org/index.php?topic=832.msg9754#msg9754)It would probably be possible to initiate an AddToBlockIndex or Reorganize after the check, but it would require a lot more careful attention.  I probably should break out part of AddToBlockIndex that sets the new best block.  I'll probably end up doing that instead of the code below.
This is what I ended up doing in SVN rev 139.

Instead of deleting the bad chain, I added an extra CheckBlock to ConnectBlock so bad blocks can't get back into the best chain once they're kicked out.