mirror of https://github.com/status-im/op-geth.git
consensus/ethash: fix the algorithm of fakeBlockNumber in comments (#17166)
correct the algorithm in the comments for fakeBlockNumber, from "min" to "max".
This commit is contained in:
parent
e8824f6e74
commit
facf1bc9d6
|
@ -356,8 +356,8 @@ func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int {
|
||||||
x.Set(params.MinimumDifficulty)
|
x.Set(params.MinimumDifficulty)
|
||||||
}
|
}
|
||||||
// calculate a fake block number for the ice-age delay:
|
// calculate a fake block number for the ice-age delay:
|
||||||
// https://github.com/ethereum/EIPs/pull/669
|
// https://github.com/ethereum/EIPs/pull/669
|
||||||
// fake_block_number = min(0, block.number - 3_000_000
|
// fake_block_number = max(0, block.number - 3_000_000)
|
||||||
fakeBlockNumber := new(big.Int)
|
fakeBlockNumber := new(big.Int)
|
||||||
if parent.Number.Cmp(big2999999) >= 0 {
|
if parent.Number.Cmp(big2999999) >= 0 {
|
||||||
fakeBlockNumber = fakeBlockNumber.Sub(parent.Number, big2999999) // Note, parent is 1 less than the actual block number
|
fakeBlockNumber = fakeBlockNumber.Sub(parent.Number, big2999999) // Note, parent is 1 less than the actual block number
|
||||||
|
|
Loading…
Reference in New Issue