diff --git a/node/node.go b/node/node.go index 4e033bc9..a49c281b 100644 --- a/node/node.go +++ b/node/node.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "sync" + "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -300,6 +301,10 @@ func EstimateSetTimezoneLocationGas(rp *rocketpool.RocketPool, timezoneLocation if err != nil { return rocketpool.GasInfo{}, err } + _, err = time.LoadLocation(timezoneLocation) + if err != nil { + return rocketpool.GasInfo{}, fmt.Errorf("Could not parse timezone [%s]: %w", timezoneLocation, err) + } return rocketNodeManager.GetTransactionGasInfo(opts, "setTimezoneLocation", timezoneLocation) } @@ -310,6 +315,10 @@ func SetTimezoneLocation(rp *rocketpool.RocketPool, timezoneLocation string, opt if err != nil { return common.Hash{}, err } + _, err = time.LoadLocation(timezoneLocation) + if err != nil { + return common.Hash{}, fmt.Errorf("Could not parse timezone [%s]: %w", timezoneLocation, err) + } hash, err := rocketNodeManager.Transact(opts, "setTimezoneLocation", timezoneLocation) if err != nil { return common.Hash{}, fmt.Errorf("Could not set node timezone location: %w", err)