fix: gas estimation error cause network error

This commit is contained in:
Anthony Laibe 2024-03-05 10:33:12 +01:00
parent 9d993ab884
commit 004bd4e79a
2 changed files with 5 additions and 2 deletions

View File

@ -1 +1 @@
0.176.2
0.176.3

View File

@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethclient"
@ -85,6 +86,8 @@ var propagateErrors = []error{
vm.ErrInvalidCode,
vm.ErrNonceUintOverflow,
core.ErrInsufficientFunds,
// Used by balance history to check state
ethereum.NotFound,
bind.ErrNoCode,
@ -154,7 +157,7 @@ func isVMError(err error) bool {
return true
}
for _, vmError := range propagateErrors {
if err == vmError {
if err == vmError || strings.Contains(err.Error(), vmError.Error()) {
return true
}
}