diff --git a/core/types/transaction.go b/core/types/transaction.go index d4a6622056..d6f13ec106 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -374,12 +374,13 @@ func (tx *Transaction) IsSystemTx() bool { return tx.inner.isSystemTx() } -// Cost returns gas * gasPrice + value. +// Cost returns (gas * gasPrice) + (blobGas * blobGasPrice) + value. func (tx *Transaction) Cost() *big.Int { total := new(big.Int).Mul(tx.GasPrice(), new(big.Int).SetUint64(tx.Gas())) if tx.Type() == BlobTxType { total.Add(total, new(big.Int).Mul(tx.BlobGasFeeCap(), new(big.Int).SetUint64(tx.BlobGas()))) } + total.Add(total, tx.Value()) return total }