mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
add comment
This commit is contained in:
parent
c8077a1748
commit
91ed443544
1 changed files with 2 additions and 0 deletions
|
|
@ -1205,6 +1205,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
|
||||||
|
|
||||||
call := args.ToMessage(header.BaseFee)
|
call := args.ToMessage(header.BaseFee)
|
||||||
|
|
||||||
|
//Get the block gas cap
|
||||||
block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash)
|
block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|
@ -1212,6 +1213,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return 0, errors.New("block not found")
|
return 0, errors.New("block not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the gas estimation andwrap any revertals into a custom return
|
// Run the gas estimation andwrap any revertals into a custom return
|
||||||
estimate, revert, err := gasestimator.Estimate(ctx, call, opts, gasCap, block.GasLimit())
|
estimate, revert, err := gasestimator.Estimate(ctx, call, opts, gasCap, block.GasLimit())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue