回复:收集交易的激励是什么?
原始发布页
打开来源页面查看 1 个交叉存档
引用 theymos 于 2010 年 6 月 5 日 下午 04:26:09 的发言
把交易加入你正在处理的区块会降低你的生成速度
这个前提是错误的。向你正在处理的区块加入更多交易并不会降低生成速度。生成程序扫描哈希时,只对区块头进行哈希,而区块头的大小是固定的。区块头包含交易的哈希(默克尔根),而且只会偶尔更新。
如有必要,我可以编写代码,让节点在一个区块没有包含足够多它们已知的交易时,倾向于不采用该区块。一个不受欢迎的区块几乎总是无法被纳入主链,但如果它确实进入了主链,仍会被接受。我怀疑这并无必要,因为节点不纳入所有交易并没有任何实际好处。
英文原文
展开英文原文
Quote from: theymos on June 05, 2010, 04:26:09 PM
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.