From 6c4dab5f7cc3d75eac451600dc86011b9a54353a Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 9 Jul 2019 00:48:18 -0700 Subject: [PATCH] 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. --- chain/bitcoind_conn.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chain/bitcoind_conn.go b/chain/bitcoind_conn.go index c522a1c..cbf4863 100644 --- a/chain/bitcoind_conn.go +++ b/chain/bitcoind_conn.go @@ -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) }