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
12
pilot.go
12
pilot.go
@ -55,18 +55,6 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey,
|
|||||||
updateStream, errChan := c.server.OpenChannel(req)
|
updateStream, errChan := c.server.OpenChannel(req)
|
||||||
select {
|
select {
|
||||||
case err := <-errChan:
|
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
|
return err
|
||||||
case <-updateStream:
|
case <-updateStream:
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user