Skip to content

Commit

Permalink
internal/ethapi: correctly calculate effective gas price (ethereum#28130
Browse files Browse the repository at this point in the history
)

correctly calculate effective gas price
  • Loading branch information
cam-schultz committed Sep 17, 2023
1 parent 9a9db3d commit 2177193
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,8 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
func effectiveGasPrice(tx *types.Transaction, baseFee *big.Int) *big.Int {
fee := tx.GasTipCap()
fee = fee.Add(fee, baseFee)
if tx.GasTipCapIntCmp(fee) < 0 {
return tx.GasTipCap()
if tx.GasFeeCapIntCmp(fee) < 0 {
return tx.GasFeeCap()
}
return fee
}
Expand Down

0 comments on commit 2177193

Please sign in to comment.