diff --git a/client.go b/client.go index 615a60de..28092a64 100644 --- a/client.go +++ b/client.go @@ -726,7 +726,7 @@ func (c *Client) connectToNode(node *Node) error { func (c *Client) connect(maxRetries int) error { retryInterval := c.config.MinReconnectInterval - for retry := 1; maxRetries == 0 || retry <= maxRetries; retry++ { + for retry := 1; maxRetries < 0 || retry <= maxRetries; retry++ { if retry > 1 { log.Printf("Retry in %v ms...", retryInterval) time.Sleep(time.Duration(retryInterval) * time.Millisecond) diff --git a/config.go b/config.go index 1e07e3f3..baedd663 100644 --- a/config.go +++ b/config.go @@ -34,7 +34,7 @@ type ClientConfig struct { RPCTimeout int32 // Timeout for each RPC call in millisecond RPCConcurrency int32 // If greater than 1, the same rpc request will be concurrently sent to multiple seed rpc nodes MsgChanLen int32 // Channel length for received but unproccessed messages. - ConnectRetries int32 // Connnect to node retries (including the initial connect). 0 means unlimited retries. + ConnectRetries int32 // Connnect to node retries (including the initial connect). A negative value means unlimited retries. MsgCacheExpiration int32 // Message cache expiration in millisecond for response channel, multiclient message id deduplicate, etc. MsgCacheCleanupInterval int32 // Message cache cleanup interval in millisecond. WsHandshakeTimeout int32 // WebSocket handshake timeout in millisecond.