rpcserver: allow unsafe-disconects
This commit is contained in:
parent
c976a550cb
commit
935c757102
@ -650,7 +650,7 @@ 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.
|
||||||
if len(nodeChannels) > 0 {
|
if len(nodeChannels) > 0 && !cfg.UnsafeDisconnect {
|
||||||
return nil, fmt.Errorf("cannot disconnect from peer(%x), "+
|
return nil, fmt.Errorf("cannot disconnect from peer(%x), "+
|
||||||
"all active channels with the peer need to be closed "+
|
"all active channels with the peer need to be closed "+
|
||||||
"first", pubKeyBytes)
|
"first", pubKeyBytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user