From e1a4657427d9ab09ad99f02a1c500f59143b526e Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 29 Aug 2018 02:03:02 -0700 Subject: [PATCH] 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. --- pilot.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pilot.go b/pilot.go index e0f44434..f218787b 100644 --- a/pilot.go +++ b/pilot.go @@ -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