chain: remove extraneous rpcclient.Disconnect calls from BitcoindConn

These are not needed since they have no effect when the RPC client is
making HTTP POST requests.
This commit is contained in:
Wilmer Paulino 2019-07-09 00:48:18 -07:00
parent f02166e5de
commit 6c4dab5f7c
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F

View file

@ -82,7 +82,6 @@ func NewBitcoindConn(chainParams *chaincfg.Params,
zmqBlockHost, []string{"rawblock"}, zmqPollInterval,
)
if err != nil {
client.Disconnect()
return nil, fmt.Errorf("unable to subscribe for zmq block "+
"events: %v", err)
}
@ -91,7 +90,6 @@ func NewBitcoindConn(chainParams *chaincfg.Params,
zmqTxHost, []string{"rawtx"}, zmqPollInterval,
)
if err != nil {
client.Disconnect()
zmqBlockConn.Close()
return nil, fmt.Errorf("unable to subscribe for zmq tx "+
"events: %v", err)
@ -122,11 +120,9 @@ func (c *BitcoindConn) Start() error {
// Verify that the node is running on the expected network.
net, err := c.getCurrentNet()
if err != nil {
c.client.Disconnect()
return err
}
if net != c.chainParams.Net {
c.client.Disconnect()
return fmt.Errorf("expected network %v, got %v",
c.chainParams.Net, net)
}