Eth JSON-RPC: eth_estimateGas: fix gas estimation by actually making it run. (#9564)

This commit is contained in:
raulk 2022-10-29 10:57:57 +01:00 committed by vyzo
parent 49da019bd0
commit 0bd5f1d4a4

View File

@ -605,6 +605,10 @@ func (a *EthModule) EthEstimateGas(ctx context.Context, tx api.EthCall) (api.Eth
return api.EthUint64(0), err
}
// Set the gas limit to the zero sentinel value, which makes
// gas estimation actually run.
msg.GasLimit = 0
msg, err = a.GasAPI.GasEstimateMessageGas(ctx, msg, nil, types.EmptyTSK)
if err != nil {
return api.EthUint64(0), err