mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
make basefee 0 always reachable
This commit is contained in:
parent
65d77c5129
commit
a3a86bdf19
1 changed files with 7 additions and 1 deletions
|
|
@ -89,7 +89,13 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int {
|
||||||
num.Div(num, denom.SetUint64(parentGasTarget))
|
num.Div(num, denom.SetUint64(parentGasTarget))
|
||||||
num.Div(num, denom.SetUint64(config.BaseFeeChangeDenominator()))
|
num.Div(num, denom.SetUint64(config.BaseFeeChangeDenominator()))
|
||||||
|
|
||||||
baseFee := num.Sub(parent.BaseFee, num)
|
var baseFee *big.Int
|
||||||
|
if num.Cmp(common.Big1) < 0 {
|
||||||
|
baseFee = num.Sub(parent.BaseFee, common.Big1)
|
||||||
|
} else {
|
||||||
|
baseFee = num.Sub(parent.BaseFee, num)
|
||||||
|
}
|
||||||
|
|
||||||
if baseFee.Cmp(common.Big0) < 0 {
|
if baseFee.Cmp(common.Big0) < 0 {
|
||||||
baseFee = common.Big0
|
baseFee = common.Big0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue