Apply suggestion from @s1na

This commit is contained in:
Sina M 2026-03-06 22:00:37 +01:00 committed by GitHub
parent 6d415ae79a
commit e252f442e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -322,8 +322,6 @@ func (tx *Transaction) Cost() *big.Int {
total.Mul(total, tx.inner.gasPrice())
if blobtx, ok := tx.inner.(*BlobTx); ok {
tmp := new(big.Int).SetUint64(blobtx.blobGas())
// BlobFeeCap is uint256.Int; ToBig allocates, but blob txs are rarer and
// this still removes several other allocations compared to the old code.
tmp.Mul(tmp, blobtx.BlobFeeCap.ToBig())
total.Add(total, tmp)
}