File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1870,11 +1870,13 @@ func (r *rpcServer) DisconnectPeer(ctx context.Context,
18701870
18711871 // In order to avoid erroneously disconnecting from a peer that we have
18721872 // an active channel with, if we have any channels active with this
1873- // peer, then we'll disallow disconnecting from them.
1873+ // peer, then we'll disallow disconnecting from them in certain
1874+ // situations.
18741875 if len (nodeChannels ) != 0 {
1875- // If we are not in a dev environment or the configed dev value
1876- // `unsafedisconnect` is false, we return an error since there
1877- // are active channels.
1876+ // If the configured dev value `unsafedisconnect` is false, we
1877+ // return an error since there are active channels. For
1878+ // production environments, we allow disconnecting from a peer
1879+ // even if there are channels active with them.
18781880 if ! r .cfg .Dev .GetUnsafeDisconnect () {
18791881 return nil , fmt .Errorf ("cannot disconnect from " +
18801882 "peer(%x), still has %d active channels" ,
You can’t perform that action at this time.
0 commit comments