diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/flashbotsrpc.go b/flashbotsrpc.go index 45e00bf..57f9b81 100644 --- a/flashbotsrpc.go +++ b/flashbotsrpc.go @@ -62,12 +62,14 @@ func New(url string, options ...func(rpc *FlashbotsRPC)) *FlashbotsRPC { Headers: make(map[string]string), Timeout: 30 * time.Second, } - for _, option := range options { - option(rpc) - } + rpc.client = &http.Client{ Timeout: rpc.Timeout, } + // this way if client is set explicitly it overwrites timeout preferences set above + for _, option := range options { + option(rpc) + } return rpc }