mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
fix DoEstimateGas
This commit is contained in:
parent
0db99f4e40
commit
a53e59b279
1 changed files with 4 additions and 1 deletions
|
|
@ -818,7 +818,10 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
|
||||||
if state == nil || err != nil {
|
if state == nil || err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if err := overrides.Apply(state, nil); err != nil {
|
blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil)
|
||||||
|
rules := b.ChainConfig().Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time)
|
||||||
|
precompiles := vm.ActivePrecompiledContracts(rules)
|
||||||
|
if err := overrides.Apply(state, precompiles); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
// Construct the gas estimator option from the user input
|
// Construct the gas estimator option from the user input
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue