From a11e9e4144ebf3b5decdf32516bbc3ae01917369 Mon Sep 17 00:00:00 2001 From: ilan gitter Date: Sat, 26 Oct 2019 10:39:14 -0400 Subject: [PATCH] backends: add lock back to estimategas --- accounts/abi/bind/backends/simulated.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index cec78f34ce..eec2ac78c9 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -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 // returns the used amount of gas. 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 var ( lo uint64 = params.TxGas - 1