原始文献 / 论坛帖 / Re: What is the incentive to collect transactions?
Re: What is the incentive to collect transactions?
Bitcointalk · 2010-06-15 23:41:29 UTC
引用 theymos(June 05, 2010, 04:26:09 PM)(https://bitcointalk.org/index.php?topic=165.msg1373#msg1373):
往你正在挖的区块里加交易会拖慢你的生成速度
这个前提是错的。往你正在挖的区块里加更多交易,并不会拖慢你的生成速度。generate 扫描哈希时只哈希区块头,区块头是固定大小的。区块头里包含交易的哈希(默克尔根),只是偶尔更新一下。
如果有必要,我可以写代码让节点倾向于不用交易太少的区块。一个交易不够多的区块几乎总是进不了主链,但万一进去了也会被接受。我怀疑这没必要,因为节点不打包全部交易并没有什么好处。
英文原文
Quote from: theymos on June 05, 2010, 04:26:09 PM(https://bitcointalk.org/index.php?topic=165.msg1373#msg1373):
> Adding transactions to the block you're working on will slow down your generation rate
>
The premise is false. Adding more transactions to the block you're working on does NOT slow down your generation rate. When generate is scanning hashes, it only hashes the header of the block, which is constant size. The header contains a hash of the transactions (the Merkle root) and is only updated occasionally.
If necessary I can write code to make nodes prefer not to use a block if it doesn't contain enough of the transactions they know about. A discouraged block would almost always fail to be included in the main chain, but would be accepted if it did get in. I doubt this will be necessary, since there's no real advantage for nodes not to include all transactions.
