diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-09-14 15:29:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 15:29:08 +0800 |
commit | 885c13c2c941710f5545bee01541e6f7602599aa (patch) | |
tree | 1c13d07970c559b460e83d686ce71cbb484de2ab /consensus/ethash/consensus.go | |
parent | 79b11121a7e4beef0d0297894289200b9842c36c (diff) | |
parent | 5bbd7fb390a539a7183bccc5f2b75b4e564ed398 (diff) | |
download | go-tangerine-885c13c2c941710f5545bee01541e6f7602599aa.tar.gz go-tangerine-885c13c2c941710f5545bee01541e6f7602599aa.tar.zst go-tangerine-885c13c2c941710f5545bee01541e6f7602599aa.zip |
Merge pull request #15146 from karalabe/byzantium-rebrand
consensus, core, params: rebrand Metro to Byzantium
Diffstat (limited to 'consensus/ethash/consensus.go')
-rw-r--r-- | consensus/ethash/consensus.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index b71420445..6a19d449f 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -36,9 +36,9 @@ import ( // Ethash proof-of-work protocol constants. var ( - frontierBlockReward *big.Int = big.NewInt(5e+18) // Block reward in wei for successfully mining a block - metropolisBlockReward *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Metropolis - maxUncles = 2 // Maximum number of uncles allowed in a single block + frontierBlockReward *big.Int = big.NewInt(5e+18) // Block reward in wei for successfully mining a block + byzantiumBlockReward *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium + maxUncles = 2 // Maximum number of uncles allowed in a single block ) // Various error messages to mark blocks invalid. These should be private to @@ -290,8 +290,8 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent * func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int { next := new(big.Int).Add(parent.Number, big1) switch { - case config.IsMetropolis(next): - return calcDifficultyMetropolis(time, parent) + case config.IsByzantium(next): + return calcDifficultyByzantium(time, parent) case config.IsHomestead(next): return calcDifficultyHomestead(time, parent) default: @@ -310,10 +310,10 @@ var ( big2999999 = big.NewInt(2999999) ) -// calcDifficultyMetropolis is the difficulty adjustment algorithm. It returns +// calcDifficultyByzantium is the difficulty adjustment algorithm. It returns // the difficulty that a new block should have when created at time given the -// parent block's time and difficulty. The calculation uses the Metropolis rules. -func calcDifficultyMetropolis(time uint64, parent *types.Header) *big.Int { +// parent block's time and difficulty. The calculation uses the Byzantium rules. +func calcDifficultyByzantium(time uint64, parent *types.Header) *big.Int { // https://github.com/ethereum/EIPs/issues/100. // algorithm: // diff = (parent_diff + @@ -530,8 +530,8 @@ var ( func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, uncles []*types.Header) { // Select the correct block reward based on chain progression blockReward := frontierBlockReward - if config.IsMetropolis(header.Number) { - blockReward = metropolisBlockReward + if config.IsByzantium(header.Number) { + blockReward = byzantiumBlockReward } // Accumulate the rewards for the miner and any included uncles reward := new(big.Int).Set(blockReward) |