core: move balanceCheck addition in buyGas (#29762)
It's a bit confusing to add msg.value into the balanceCheck within the conditional. No impact on block validation since GasFeeCap is always set when processing transactions.
This commit is contained in:
parent
d2f00cb54e
commit
7ed52c949e
|
@ -240,8 +240,9 @@ func (st *StateTransition) buyGas() error {
|
||||||
if st.msg.GasFeeCap != nil {
|
if st.msg.GasFeeCap != nil {
|
||||||
balanceCheck.SetUint64(st.msg.GasLimit)
|
balanceCheck.SetUint64(st.msg.GasLimit)
|
||||||
balanceCheck = balanceCheck.Mul(balanceCheck, st.msg.GasFeeCap)
|
balanceCheck = balanceCheck.Mul(balanceCheck, st.msg.GasFeeCap)
|
||||||
balanceCheck.Add(balanceCheck, st.msg.Value)
|
|
||||||
}
|
}
|
||||||
|
balanceCheck.Add(balanceCheck, st.msg.Value)
|
||||||
|
|
||||||
if st.evm.ChainConfig().IsCancun(st.evm.Context.BlockNumber, st.evm.Context.Time) {
|
if st.evm.ChainConfig().IsCancun(st.evm.Context.BlockNumber, st.evm.Context.Time) {
|
||||||
if blobGas := st.blobGasUsed(); blobGas > 0 {
|
if blobGas := st.blobGasUsed(); blobGas > 0 {
|
||||||
// Check that the user has enough funds to cover blobGasUsed * tx.BlobGasFeeCap
|
// Check that the user has enough funds to cover blobGasUsed * tx.BlobGasFeeCap
|
||||||
|
|
Loading…
Reference in New Issue