Move Disconnected next to Disconnect func.

This commit is contained in:
Dave Collins 2014-05-05 19:51:33 -05:00
parent 1122a8a9cb
commit 7c552136bc

View file

@ -526,14 +526,6 @@ func (c *Client) sendPostRequest(req *http.Request, command btcjson.Cmd, respons
}
}
// Disconnected returns whether or not the server is disconnected.
func (c *Client) Disconnected() bool {
c.mtx.Lock()
defer c.mtx.Unlock()
return c.disconnected
}
// newFutureError returns a new future result channel that already has the
// passed error waitin on the channel with the reply set to nil. This is useful
// to easily return errors from the various Async functions.
@ -649,6 +641,14 @@ func (c *Client) sendCmdAndWait(cmd btcjson.Cmd) (interface{}, error) {
return receiveFuture(c.sendCmd(cmd))
}
// Disconnected returns whether or not the server is disconnected.
func (c *Client) Disconnected() bool {
c.mtx.Lock()
defer c.mtx.Unlock()
return c.disconnected
}
// Disconnect disconnects the current websocket associated with the client. The
// connection will automatically be re-established
//