mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 06:01:48 +02:00
lnd: improve code comment
This commit is contained in:
10
rpcserver.go
10
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",
|
||||
|
Reference in New Issue
Block a user