aboutsummaryrefslogtreecommitdiffstats
path: root/consensus
diff options
context:
space:
mode:
authorKwuaint <34888408+kwuaint@users.noreply.github.com>2018-07-12 18:32:23 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-12 18:32:23 +0800
commitfacf1bc9d66cbe4bb5492486a6fd876a13eeb31b (patch)
treed7dd2a4345b6cb83cce2f3f036a8c35e181a0dc3 /consensus
parente8824f6e7409a2064b1165c5b6cc6b2d390573ce (diff)
downloadgo-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar.gz
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar.bz2
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar.lz
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar.xz
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.tar.zst
go-tangerine-facf1bc9d66cbe4bb5492486a6fd876a13eeb31b.zip
consensus/ethash: fix the algorithm of fakeBlockNumber in comments (#17166)
correct the algorithm in the comments for fakeBlockNumber, from "min" to "max".
Diffstat (limited to 'consensus')
-rw-r--r--consensus/ethash/consensus.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go
index 99eec8221..bc97dbca4 100644
--- a/consensus/ethash/consensus.go
+++ b/consensus/ethash/consensus.go
@@ -356,8 +356,8 @@ func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int {
x.Set(params.MinimumDifficulty)
}
// calculate a fake block number for the ice-age delay:
- // https://github.com/ethereum/EIPs/pull/669
- // fake_block_number = min(0, block.number - 3_000_000
+ // https://github.com/ethereum/EIPs/pull/669
+ // fake_block_number = max(0, block.number - 3_000_000)
fakeBlockNumber := new(big.Int)
if parent.Number.Cmp(big2999999) >= 0 {
fakeBlockNumber = fakeBlockNumber.Sub(parent.Number, big2999999) // Note, parent is 1 less than the actual block number