blocks minus 1
Bitcointalk · 2010-08-16 15:59:25 UTC
我想把状态栏显示的块数减 1。刚打开程序时,会显示 0 个块而不是 1 个:
"0 connections 0 blocks 0 transactions"
一直以来都是 "nBestHeight + 1",因为把创世块也算进去了。严格说,创世块是个块。它是硬编码的块,你生来就有它。不可能没有创世块。可以把它想成一把 reference coin,其他币都拿它当尺子量。大家想看的块数是自己下到了多少个块。
主要好处是:块数会等于当前 best block 的块号。blocks 是 10,就说明你最高有 10 号块,没有 11 号。
也能减少这儿的 confusion:
引用自:kencausey,2010 年 8 月 15 日 11:45:26 PM(https://bitcointalk.org/index.php?topic=823.msg9588#msg9588)
引用自:davidonpda,2010 年 8 月 15 日 11:31:37 PM(https://bitcointalk.org/index.php?topic=823.msg9580#msg9580)
……它已经到 74638 块了。我猜这意思是 74638 现在是好块了?
我自己也晕过,在 #bitcoin-dev 问明白了:
坏块是 74638 号,最后一个好块是 74637。编号从 0 开始,所以客户端显示有 74638 个块,意思是你最高到 74637 号块,也就是最后一个好块。
英文原文
I'd like to reduce the number of blocks displayed in the status bar by 1. When you first load the program, it'll display 0 blocks instead of 1:
"0 connections 0 blocks 0 transactions"
It's always been "nBestHeight + 1" because it's counting the genesis block. Technically, yes, the genesis block is a block. It's a hardcoded block that you start out with. You can't not have the genesis block. Maybe think of it as a reference coin that you measure other coins against. The block count people are looking for is the number of blocks they've downloaded.
The main benefit is that blocks will be equal to the block number of the current best block. If blocks is 10, then the highest block number you have is 10. It means you have block 10 and you don't have block 11.
It would reduce the confusion we had here:
Quote from: kencausey on August 15, 2010, 11:45:26 PM(https://bitcointalk.org/index.php?topic=823.msg9588#msg9588)Quote from: davidonpda on August 15, 2010, 11:31:37 PM(https://bitcointalk.org/index.php?topic=823.msg9580#msg9580)... It already is on block 74638. I assume that means that block is now a good one?
I had some confusion on this myself and got clarification in #bitcoin-dev:
The bad block was number 74638, the last good one was 74637. The numbers start at 0, so when your client shows there are 74638 blocks then that means you have up to block number 74637, the last good one.
