internal/ethapi: correctly calculate effective gas price (#28130)

correctly calculate effective gas price
This commit is contained in:
cam-schultz 2023-09-17 09:00:04 -05:00 committed by GitHub
parent 9a9db3d265
commit 217719347d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1520,8 +1520,8 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
func effectiveGasPrice(tx *types.Transaction, baseFee *big.Int) *big.Int { func effectiveGasPrice(tx *types.Transaction, baseFee *big.Int) *big.Int {
fee := tx.GasTipCap() fee := tx.GasTipCap()
fee = fee.Add(fee, baseFee) fee = fee.Add(fee, baseFee)
if tx.GasTipCapIntCmp(fee) < 0 { if tx.GasFeeCapIntCmp(fee) < 0 {
return tx.GasTipCap() return tx.GasFeeCap()
} }
return fee return fee
} }