From 24e3958a0bd9739a607f00efff8c7e23ffc275a6 Mon Sep 17 00:00:00 2001 From: ziggie Date: Tue, 24 Jun 2025 16:52:55 +0200 Subject: [PATCH] lnd: improve code comment --- rpcserver.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 124f7e9dd..687cfc201 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1870,11 +1870,13 @@ func (r *rpcServer) DisconnectPeer(ctx context.Context, // In order to avoid erroneously disconnecting from a peer that we have // an active channel with, if we have any channels active with this - // peer, then we'll disallow disconnecting from them. + // peer, then we'll disallow disconnecting from them in certain + // situations. if len(nodeChannels) != 0 { - // If we are not in a dev environment or the configed dev value - // `unsafedisconnect` is false, we return an error since there - // are active channels. + // If the configured dev value `unsafedisconnect` is false, we + // return an error since there are active channels. For + // production environments, we allow disconnecting from a peer + // even if there are channels active with them. if !r.cfg.Dev.GetUnsafeDisconnect() { return nil, fmt.Errorf("cannot disconnect from "+ "peer(%x), still has %d active channels",