config+rpcserver: hide deprecated option unsafe-disconnect

Also fix a case where this deprecated flag is used. We will always
bypass the active channels check when `DisconnectPeer` because
`!r.cfg.UnsafeDisconnect` is always false.
This commit is contained in:
yyforyongyu committed 2024-02-01 21:20:11 +08:00
1 parent 157c84cc4d
commit 78d552de22
2 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -1747,7 +1747,7 @@ 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.
if len(nodeChannels) > 0 && !r.cfg.UnsafeDisconnect {
if len(nodeChannels) > 0 {
return nil, fmt.Errorf("cannot disconnect from peer(%x), "+
"all active channels with the peer need to be closed "+
"first", pubKeyBytes)