Skip to content

Commit facf1bc

Browse files
kwuaintkaralabe
authored andcommitted
consensus/ethash: fix the algorithm of fakeBlockNumber in comments (#17166)
correct the algorithm in the comments for fakeBlockNumber, from "min" to "max".
1 parent e8824f6 commit facf1bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎consensus/ethash/consensus.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int {
356356
x.Set(params.MinimumDifficulty)
357357
}
358358
// calculate a fake block number for the ice-age delay:
359-
// https://github.com/ethereum/EIPs/pull/669
360-
// fake_block_number = min(0, block.number - 3_000_000
359+
// https://github.com/ethereum/EIPs/pull/669
360+
// fake_block_number = max(0, block.number - 3_000_000)
361361
fakeBlockNumber := new(big.Int)
362362
if parent.Number.Cmp(big2999999) >= 0 {
363363
fakeBlockNumber = fakeBlockNumber.Sub(parent.Number, big2999999) // Note, parent is 1 less than the actual block number

0 commit comments

Comments
 (0)