浏览代码

consensus/ethash: fix byzantium difficulty comment typo (#15842)

gary rong 7 年之前
父节点
当前提交
3a5a5599dd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      consensus/ethash/consensus.go

+ 1 - 1
consensus/ethash/consensus.go

@@ -347,7 +347,7 @@ func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int {
 	if x.Cmp(bigMinus99) < 0 {
 	if x.Cmp(bigMinus99) < 0 {
 		x.Set(bigMinus99)
 		x.Set(bigMinus99)
 	}
 	}
-	// (parent_diff + parent_diff // 2048 * max(1 - (block_timestamp - parent_timestamp) // 10, -99))
+	// parent_diff + (parent_diff / 2048 * max((2 if len(parent.uncles) else 1) - ((timestamp - parent.timestamp) // 9), -99))
 	y.Div(parent.Difficulty, params.DifficultyBoundDivisor)
 	y.Div(parent.Difficulty, params.DifficultyBoundDivisor)
 	x.Mul(y, x)
 	x.Mul(y, x)
 	x.Add(parent.Difficulty, x)
 	x.Add(parent.Difficulty, x)