diff --git a/core/chain_util.go b/core/chain_util.go index 7e99c7d4c1..3078fcc1df 100644 --- a/core/chain_util.go +++ b/core/chain_util.go @@ -41,7 +41,7 @@ var ( func CalcDifficulty(time, parentTime uint64, parentNumber, parentDiff *big.Int) *big.Int { diff := new(big.Int) - if parentNumber <= 23000 { + if parentNumber <= params.HardFork1 { adjust := new(big.Int).Div(parentDiff, params.DifficultyBoundDivisor) } else { adjust := new(big.Int).Div(parentDiff, params.DifficultyBoundDivisor2) diff --git a/params/protocol_params.go b/params/protocol_params.go index ca4a2001c7..e3b89f22b1 100755 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -31,6 +31,7 @@ var ( TxDataZeroGas = big.NewInt(4) // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisor2 = big.NewInt(512) // Difficulty should adjust faster. + HardFork1 = big.NewInt(23000) // fork at this block number QuadCoeffDiv = big.NewInt(512) // Divisor for the quadratic particle of the memory cost equation. GenesisDifficulty = big.NewInt(131072) // Difficulty of the Genesis block. DurationLimit = big.NewInt(60) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.