mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
core: use max to simplify function CalcGasLimit (#1902)
This commit is contained in:
parent
267222d4a5
commit
acd3eb93e8
1 changed files with 1 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue