mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
backends: add lock back to estimategas
This commit is contained in:
parent
ed6b7dec52
commit
a11e9e4144
1 changed files with 3 additions and 0 deletions
|
|
@ -367,6 +367,9 @@ func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error
|
||||||
// EstimateGas executes the requested code against the currently pending block/state and
|
// EstimateGas executes the requested code against the currently pending block/state and
|
||||||
// returns the used amount of gas.
|
// returns the used amount of gas.
|
||||||
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
|
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
|
||||||
|
b.mu.Lock()
|
||||||
|
defer b.mu.Unlock()
|
||||||
|
|
||||||
// Determine the lowest and highest possible gas limits to binary search in between
|
// Determine the lowest and highest possible gas limits to binary search in between
|
||||||
var (
|
var (
|
||||||
lo uint64 = params.TxGas - 1
|
lo uint64 = params.TxGas - 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue