Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the resetOrigin call on ensureConnection that turned out unnecessary #172

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions pkg/websocketclient/websocketclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ func NewWebsocketClient(cfg *config.ChiaConfig, options ...rpcinterface.ClientOp
return c, nil
}

// resetOrigin so we get a unique identifier if we have to establish a new connection
// Helps ensure that we don't end up getting duplicate messages
func (c *WebsocketClient) resetOrigin() {
c.origin = fmt.Sprintf("go-chia-rpc-%d", time.Now().UnixNano())
}

// SetBaseURL sets the base URL for API requests to a custom endpoint.
func (c *WebsocketClient) SetBaseURL(url *url.URL) error {
c.baseURL = url
Expand Down Expand Up @@ -393,7 +387,6 @@ func (c *WebsocketClient) generateDialer() error {
// ensureConnection ensures there is an open websocket connection and the listener is listening
func (c *WebsocketClient) ensureConnection() error {
if c.conn == nil {
c.resetOrigin()
u := url.URL{Scheme: "wss", Host: fmt.Sprintf("%s:%d", c.baseURL.Host, c.daemonPort), Path: "/"}
var err error
c.conn, _, err = c.daemonDialer.Dial(u.String(), nil)
Expand Down