mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
blobBalanceUsage: Adding check for balance.
This commit is contained in:
parent
f83fe44326
commit
fcee52406e
1 changed files with 3 additions and 0 deletions
|
|
@ -83,6 +83,9 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin
|
|||
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))
|
||||
blobBalanceUsage.Mul(blobBalanceUsage, call.BlobGasFeeCap)
|
||||
if blobBalanceUsage.Cmp(available) >= 0 {
|
||||
return 0, nil, core.ErrInsufficientFunds
|
||||
}
|
||||
available.Sub(available, blobBalanceUsage)
|
||||
}
|
||||
allowance := new(big.Int).Div(available, feeCap)
|
||||
|
|
|
|||
Loading…
Reference in a new issue