From 6a426f420f88be050d8c21e1d4e072b1a1f2e7eb Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Fri, 24 Aug 2018 17:20:51 -0700 Subject: [PATCH] Fixed gas limit setting was not enforced --- core/block_validator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/block_validator.go b/core/block_validator.go index 861f30578d6b..281feea7df8a 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -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