Rename HttpPostMode conn param to HTTPPostMode.
This rename is to make golint happy.
This commit is contained in:
parent
c4bc5220bc
commit
774eb787a8
3 changed files with 17 additions and 17 deletions
|
@ -16,7 +16,7 @@ func main() {
|
|||
Host: "localhost:8332",
|
||||
User: "yourrpcuser",
|
||||
Pass: "yourrpcpass",
|
||||
HttpPostMode: true, // Bitcoin core only supports HTTP POST mode
|
||||
HTTPPostMode: true, // Bitcoin core only supports HTTP POST mode
|
||||
DisableTLS: true, // Bitcoin core does not provide TLS by default
|
||||
}
|
||||
// Notice the notification parameter is nil since notifications are
|
||||
|
|
|
@ -789,7 +789,7 @@ func (c *Client) sendRequest(jReq *jsonRequest) {
|
|||
// the client running in HTTP POST mode or not. When running in HTTP
|
||||
// POST mode, the command is issued via an HTTP client. Otherwise,
|
||||
// the command is issued via the asynchronous websocket channels.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
c.sendPost(jReq)
|
||||
return
|
||||
}
|
||||
|
@ -876,7 +876,7 @@ func (c *Client) Disconnected() bool {
|
|||
//
|
||||
// This function is safe for concurrent access.
|
||||
func (c *Client) doDisconnect() bool {
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -979,7 +979,7 @@ func (c *Client) start() {
|
|||
|
||||
// Start the I/O processing handlers depending on whether the client is
|
||||
// in HTTP POST mode or the default websocket mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
c.wg.Add(1)
|
||||
go c.sendPostHandler()
|
||||
} else {
|
||||
|
@ -1055,13 +1055,13 @@ type ConnConfig struct {
|
|||
// called manually.
|
||||
DisableConnectOnNew bool
|
||||
|
||||
// HttpPostMode instructs the client to run using multiple independent
|
||||
// HTTPPostMode instructs the client to run using multiple independent
|
||||
// connections issuing HTTP POST requests instead of using the default
|
||||
// of websockets. Websockets are generally preferred as some of the
|
||||
// features of the client such notifications only work with websockets,
|
||||
// however, not all servers support the websocket extensions, so this
|
||||
// flag can be set to true to use basic HTTP POST requests instead.
|
||||
HttpPostMode bool
|
||||
HTTPPostMode bool
|
||||
|
||||
// EnableBCInfoHacks is an option provided to enable compatiblity hacks
|
||||
// when connecting to blockchain.info RPC server
|
||||
|
@ -1182,7 +1182,7 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
|
|||
var httpClient *http.Client
|
||||
connEstablished := make(chan struct{})
|
||||
var start bool
|
||||
if config.HttpPostMode {
|
||||
if config.HTTPPostMode {
|
||||
ntfnHandlers = nil
|
||||
start = true
|
||||
|
||||
|
@ -1222,7 +1222,7 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
|
|||
if start {
|
||||
close(connEstablished)
|
||||
client.start()
|
||||
if !client.config.HttpPostMode && !client.config.DisableAutoReconnect {
|
||||
if !client.config.HTTPPostMode && !client.config.DisableAutoReconnect {
|
||||
client.wg.Add(1)
|
||||
go client.wsReconnectHandler()
|
||||
}
|
||||
|
@ -1246,7 +1246,7 @@ func (c *Client) Connect(tries int) error {
|
|||
c.mtx.Lock()
|
||||
defer c.mtx.Unlock()
|
||||
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return ErrNotWebsocketClient
|
||||
}
|
||||
if c.wsConn != nil {
|
||||
|
|
16
notify.go
16
notify.go
|
@ -666,7 +666,7 @@ func (r FutureNotifyBlocksResult) Receive() error {
|
|||
// NOTE: This is a btcd extension and requires a websocket connection.
|
||||
func (c *Client) NotifyBlocksAsync() FutureNotifyBlocksResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -714,7 +714,7 @@ func (r FutureNotifySpentResult) Receive() error {
|
|||
// recreate the previous notification state on reconnect.
|
||||
func (c *Client) notifySpentInternal(outpoints []btcjson.OutPoint) FutureNotifySpentResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -737,7 +737,7 @@ func (c *Client) notifySpentInternal(outpoints []btcjson.OutPoint) FutureNotifyS
|
|||
// NOTE: This is a btcd extension and requires a websocket connection.
|
||||
func (c *Client) NotifySpentAsync(outpoints []*wire.OutPoint) FutureNotifySpentResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -793,7 +793,7 @@ func (r FutureNotifyNewTransactionsResult) Receive() error {
|
|||
// NOTE: This is a btcd extension and requires a websocket connection.
|
||||
func (c *Client) NotifyNewTransactionsAsync(verbose bool) FutureNotifyNewTransactionsResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -842,7 +842,7 @@ func (r FutureNotifyReceivedResult) Receive() error {
|
|||
// recreate the previous notification state on reconnect.
|
||||
func (c *Client) notifyReceivedInternal(addresses []string) FutureNotifyReceivedResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -866,7 +866,7 @@ func (c *Client) notifyReceivedInternal(addresses []string) FutureNotifyReceived
|
|||
// NOTE: This is a btcd extension and requires a websocket connection.
|
||||
func (c *Client) NotifyReceivedAsync(addresses []btcutil.Address) FutureNotifyReceivedResult {
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -939,7 +939,7 @@ func (c *Client) RescanAsync(startBlock *wire.ShaHash,
|
|||
outpoints []*wire.OutPoint) FutureRescanResult {
|
||||
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ func (c *Client) RescanEndBlockAsync(startBlock *wire.ShaHash,
|
|||
endBlock *wire.ShaHash) FutureRescanResult {
|
||||
|
||||
// Not supported in HTTP POST mode.
|
||||
if c.config.HttpPostMode {
|
||||
if c.config.HTTPPostMode {
|
||||
return newFutureError(ErrNotificationsNotSupported)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue