mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
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:
parent
e1a376d9f8
commit
e1a4657427
1 changed files with 0 additions and 12 deletions
12
pilot.go
12
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
|
||||
|
|
Loading…
Add table
Reference in a new issue