pilot: remove disconnection logic from chanController

In this commit, we remove the disconnection logic within the
chanController when failing to open a channel with a peer. We do this as
it's already done within the autopilot agent, where it should be, and
because it's possible that we were already connected to this node and we
happened to disconnect them anyway.
This commit is contained in:
Wilmer Paulino 2018-08-29 02:03:02 -07:00
parent e1a376d9f8
commit e1a4657427
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -55,18 +55,6 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey,
updateStream, errChan := c.server.OpenChannel(req)
select {
case err := <-errChan:
// If we were not able to actually open a channel to the peer
// for whatever reason, then we'll disconnect from the peer to
// ensure we don't accumulate a bunch of unnecessary
// connections.
if err != nil {
dcErr := c.server.DisconnectPeer(target)
if dcErr != nil {
atplLog.Errorf("Unable to disconnect from peer %v",
target.SerializeCompressed())
}
}
return err
case <-updateStream:
return nil