Skip to content

Commit

Permalink
fix http client configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Aug 5, 2024
1 parent 3dc3c4e commit 375618e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
8 changes: 5 additions & 3 deletions flashbotsrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 375618e

Please sign in to comment.