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,
1870
1870
1871
1871
// In order to avoid erroneously disconnecting from a peer that we have
1872
1872
// 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.
1874
1875
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.
1878
1880
if ! r .cfg .Dev .GetUnsafeDisconnect () {
1879
1881
return nil , fmt .Errorf ("cannot disconnect from " +
1880
1882
"peer(%x), still has %d active channels" ,
You can’t perform that action at this time.
0 commit comments