aboutsummaryrefslogtreecommitdiffstats
path: root/consensus/ethash/consensus.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-01-10 16:58:03 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-10 16:58:03 +0800
commit3a5a5599dd387e70da2df3240fa5553722851bb9 (patch)
treea6a754d45b5cc3f19c8232b0834baa74ef1a804a /consensus/ethash/consensus.go
parent83d16574444d0b389755c9003e74a90d2ab7ca2e (diff)
downloadgo-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar.gz
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar.bz2
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar.lz
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar.xz
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.tar.zst
go-tangerine-3a5a5599dd387e70da2df3240fa5553722851bb9.zip
consensus/ethash: fix byzantium difficulty comment typo (#15842)
Diffstat (limited to 'consensus/ethash/consensus.go')
-rw-r--r--consensus/ethash/consensus.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go
index 0af68c31a..82d23c92b 100644
--- a/consensus/ethash/consensus.go
+++ b/consensus/ethash/consensus.go
@@ -347,7 +347,7 @@ func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int {
if x.Cmp(bigMinus99) < 0 {
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)
x.Mul(y, x)
x.Add(parent.Difficulty, x)