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:
parent
f02166e5de
commit
6c4dab5f7c
1 changed files with 0 additions and 4 deletions
|
@ -82,7 +82,6 @@ func NewBitcoindConn(chainParams *chaincfg.Params,
|
||||||
zmqBlockHost, []string{"rawblock"}, zmqPollInterval,
|
zmqBlockHost, []string{"rawblock"}, zmqPollInterval,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.Disconnect()
|
|
||||||
return nil, fmt.Errorf("unable to subscribe for zmq block "+
|
return nil, fmt.Errorf("unable to subscribe for zmq block "+
|
||||||
"events: %v", err)
|
"events: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -91,7 +90,6 @@ func NewBitcoindConn(chainParams *chaincfg.Params,
|
||||||
zmqTxHost, []string{"rawtx"}, zmqPollInterval,
|
zmqTxHost, []string{"rawtx"}, zmqPollInterval,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.Disconnect()
|
|
||||||
zmqBlockConn.Close()
|
zmqBlockConn.Close()
|
||||||
return nil, fmt.Errorf("unable to subscribe for zmq tx "+
|
return nil, fmt.Errorf("unable to subscribe for zmq tx "+
|
||||||
"events: %v", err)
|
"events: %v", err)
|
||||||
|
@ -122,11 +120,9 @@ func (c *BitcoindConn) Start() error {
|
||||||
// Verify that the node is running on the expected network.
|
// Verify that the node is running on the expected network.
|
||||||
net, err := c.getCurrentNet()
|
net, err := c.getCurrentNet()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.client.Disconnect()
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if net != c.chainParams.Net {
|
if net != c.chainParams.Net {
|
||||||
c.client.Disconnect()
|
|
||||||
return fmt.Errorf("expected network %v, got %v",
|
return fmt.Errorf("expected network %v, got %v",
|
||||||
c.chainParams.Net, net)
|
c.chainParams.Net, net)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue