lnd: improve code comment
This commit is contained in:
1 file changed
+6
-4
+6
-4
@@ -1870,11 +1870,13 @@ func (r *rpcServer) DisconnectPeer(ctx context.Context,
|
|||||||
|
|
||||||
// In order to avoid erroneously disconnecting from a peer that we have
|
// In order to avoid erroneously disconnecting from a peer that we have
|
||||||
// an active channel with, if we have any channels active with this
|
// 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 len(nodeChannels) != 0 {
|
||||||
// If we are not in a dev environment or the configed dev value
|
// If the configured dev value `unsafedisconnect` is false, we
|
||||||
// `unsafedisconnect` is false, we return an error since there
|
// return an error since there are active channels. For
|
||||||
// are active channels.
|
// production environments, we allow disconnecting from a peer
|
||||||
|
// even if there are channels active with them.
|
||||||
if !r.cfg.Dev.GetUnsafeDisconnect() {
|
if !r.cfg.Dev.GetUnsafeDisconnect() {
|
||||||
return nil, fmt.Errorf("cannot disconnect from "+
|
return nil, fmt.Errorf("cannot disconnect from "+
|
||||||
"peer(%x), still has %d active channels",
|
"peer(%x), still has %d active channels",
|
||||||
|
|||||||
Reference in new issue
Block a user