mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Update gasestimator.go
This commit is contained in:
parent
a976688c1e
commit
e41244d7d1
1 changed files with 3 additions and 1 deletions
|
|
@ -81,7 +81,9 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin
|
|||
available.Sub(available, call.Value)
|
||||
}
|
||||
if opts.Config.IsCancun(opts.Header.Number, opts.Header.Time) && len(call.BlobHashes) > 0 {
|
||||
blobBalanceUsage := new(big.Int).SetInt64(int64(len(call.BlobHashes)) * params.BlobTxBlobGasPerBlob)
|
||||
blobGasPerBlob := new(big.Int).SetInt64(params.BlobTxBlobGasPerBlob)
|
||||
blobBalanceUsage := new(big.Int).SetInt64(int64(len(call.BlobHashes)))
|
||||
blobBalanceUsage.Mul(blobBalanceUsage, blobGasPerBlob)
|
||||
blobBalanceUsage.Mul(blobBalanceUsage, call.BlobGasFeeCap)
|
||||
if blobBalanceUsage.Cmp(available) >= 0 {
|
||||
return 0, nil, core.ErrInsufficientFunds
|
||||
|
|
|
|||
Loading…
Reference in a new issue