Skip to content

Commit 24e3958

Browse files
committed
lnd: improve code comment
1 parent 409561a commit 24e3958

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rpcserver.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)