Skip to content

Commit

Permalink
Merged in coinplugin/go-metadium (pull request #6)
Browse files Browse the repository at this point in the history
Fixed gas limit setting was not enforced

Approved-by: Uh Sado <sadoc@metadium.com>
  • Loading branch information
sadoci committed Aug 25, 2018
2 parents 12637f5 + 6a426f4 commit 83bf5db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *stat
// CalcGasLimit computes the gas limit of the next block after parent.
// This is miner strategy, not consensus protocol.
func CalcGasLimit(parent *types.Block) uint64 {
if params.FixedGasLimit != 0 {
return params.FixedGasLimit
}

// contrib = (parentGasUsed * 3 / 2) / 1024
contrib := (parent.GasUsed() + parent.GasUsed()/2) / params.GasLimitBoundDivisor

Expand Down

0 comments on commit 83bf5db

Please sign in to comment.