diff --git a/core/block_validator.go b/core/block_validator.go index d1c5645b0758..a646fd127d89 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -189,10 +189,7 @@ func CalcGasLimit(parent *types.Block) uint64 { at that usage) the amount increased/decreased depends on how far away from parentGasLimit * (2/3) parentGasUsed is. */ - limit := parent.GasLimit() - decay + contrib - if limit < params.MinGasLimit { - limit = params.MinGasLimit - } + limit := max(parent.GasLimit()-decay+contrib, params.MinGasLimit) // however, if we're now below the target (TargetGasLimit) we increase the // limit as much as we can (parentGasLimit / 1024 -1) if limit < params.TargetGasLimit {