回复:[补丁] 自动区块验证
原始发布页
打开来源页面查看 1 个交叉存档
引用自:satoshi,2010 年 8 月 16 日 03:25:54 PM
检查之后大概可以启动一次 AddToBlockIndex 或 Reorganize,但这需要更加仔细地处理。我或许应该把 AddToBlockIndex 中设置新最佳区块的那部分拆出来。我最后大概会那样做,而不是采用下面的代码。
这就是我最终在 SVN rev 139 中采用的做法。
我没有删除坏链,而是在 ConnectBlock 中额外添加了一次 CheckBlock,这样坏区块一旦被踢出去,就无法重新进入最佳链。
英文原文
展开英文原文
Quote from: satoshi on August 16, 2010, 03:25:54 PM
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.