From 90f9985dd209a6f2b0fc89b7c5c1c8e341229030 Mon Sep 17 00:00:00 2001 From: andrewtoth Date: Wed, 3 Apr 2019 22:08:23 -0400 Subject: [PATCH] Update disconnect manpage --- doc/lightning-disconnect.7 | 22 +++++++++++++++++----- doc/lightning-disconnect.7.txt | 10 ++++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/lightning-disconnect.7 b/doc/lightning-disconnect.7 index a6c5fad76..11fbb9936 100644 --- a/doc/lightning-disconnect.7 +++ b/doc/lightning-disconnect.7 @@ -2,12 +2,12 @@ .\" Title: lightning-disconnect .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 12/04/2018 +.\" Date: 04/03/2019 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "LIGHTNING\-DISCONNEC" "7" "12/04/2018" "\ \&" "\ \&" +.TH "LIGHTNING\-DISCONNEC" "7" "04/03/2019" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,10 +31,10 @@ lightning-disconnect \- Command for disconnecting from another lightning node\&. .SH "SYNOPSIS" .sp -\fBdisconnect\fR \fIid\fR +\fBdisconnect\fR \fIid\fR [\fIforce\fR] .SH "DESCRIPTION" .sp -The disconnect RPC command closes an existing connection to a peer, identified by \fIid\fR, in the Lightning Network, as long as it doesn\(cqt have an active channel\&. +The disconnect RPC command closes an existing connection to a peer, identified by \fIid\fR, in the Lightning Network, as long as it doesn\(cqt have an active channel\&. If \fIforce\fR is set then it will disconnect even with an active channel\&. .sp The \fIid\fR can be discovered in the output of the listpeers command, which returns a set of peers: .sp @@ -56,7 +56,7 @@ The \fIid\fR can be discovered in the output of the listpeers command, which ret .RE .\} .sp -Passing the \fIid\fR attribute of a peer to lightning\-disconnect will terminate the connection\&. +Passing the \fIid\fR attribute of a peer to \fIdisconnect\fR will terminate the connection\&. .SH "RETURN VALUE" .sp On success, an empty object is returned\&. @@ -73,6 +73,18 @@ If \fIid\fR is invalid, an error message will be returned: .if n \{\ .RE .\} +.sp +If the peer has an active channel and \fIforce\fR is not set, an error message will be returned: +.sp +.if n \{\ +.RS 4 +.\} +.nf +{ "code" : \-1, "message" : "Peer is in state CHANNELD_NORMAL" } +.fi +.if n \{\ +.RE +.\} .SH "AUTHOR" .sp Michael Hawkins \&. diff --git a/doc/lightning-disconnect.7.txt b/doc/lightning-disconnect.7.txt index c47f2320a..7c48551fa 100644 --- a/doc/lightning-disconnect.7.txt +++ b/doc/lightning-disconnect.7.txt @@ -8,13 +8,14 @@ lightning-disconnect - Command for disconnecting from another lightning node. SYNOPSIS -------- -*disconnect* 'id' +*disconnect* 'id' ['force'] DESCRIPTION ----------- The disconnect RPC command closes an existing connection to a peer, identified by 'id', in the Lightning Network, as long as it -doesn't have an active channel. +doesn't have an active channel. If 'force' is set then it will disconnect +even with an active channel. The 'id' can be discovered in the output of the listpeers command, which returns a set of peers: @@ -42,6 +43,11 @@ If 'id' is invalid, an error message will be returned: { "code" : -1, "message" : "Peer not connected" } +If the peer has an active channel and 'force' is not set, an error message +will be returned: + + { "code" : -1, "message" : "Peer is in state CHANNELD_NORMAL" } + AUTHOR ------ Michael Hawkins .