2019-08-10 02:12:44 +02:00
|
|
|
.TH "LIGHTNING-CLOSE" "7" "" "" "lightning-close"
|
|
|
|
.SH NAME
|
|
|
|
lightning-close - Command for closing channels with direct peers
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
2019-09-29 21:24:22 +02:00
|
|
|
\fBclose\fR \fIid\fR [\fIunilateraltimeout\fR] [\fIdestination\fR]
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
The \fBclose\fR RPC command attempts to close the channel cooperatively
|
2019-09-29 21:24:22 +02:00
|
|
|
with the peer, or unilaterally after \fIunilateraltimeout\fR, and the
|
|
|
|
to-local output will be sent to the address specified in \fIdestination\fR\.
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
If the given \fIid\fR is a peer ID (66 hex digits as a string), then it
|
|
|
|
applies to the active channel of the direct peer corresponding to the
|
|
|
|
given peer ID\. If the given \fIid\fR is a channel ID (64 hex digits as a
|
|
|
|
string, or the short channel ID \fIblockheight:txindex:outindex\fR form),
|
|
|
|
then it applies to that channel\.
|
|
|
|
|
|
|
|
|
|
|
|
If \fIunilateraltimeout\fR is not zero, the \fBclose\fR command will
|
|
|
|
unilaterally close the channel when that number of seconds is reached\.
|
|
|
|
If \fIunilateraltimeout\fR is zero, then the \fBclose\fR command will wait
|
|
|
|
indefinitely until the peer is online and can negotiate a mutual close\.
|
|
|
|
The default is 2 days (172800 seconds)\.
|
|
|
|
|
|
|
|
|
2019-09-29 21:24:22 +02:00
|
|
|
The \fIdestination\fR can be of any Bitcoin accepted type, including bech32\.
|
|
|
|
If it isn't specified, the default is a c-lightning wallet address\.
|
|
|
|
|
|
|
|
|
2019-08-10 02:12:44 +02:00
|
|
|
The peer needs to be live and connected in order to negotiate a mutual
|
|
|
|
close\. The default of unilaterally closing after 48 hours is usually a
|
|
|
|
reasonable indication that you can no longer contact the peer\.
|
|
|
|
|
|
|
|
.SH NOTES
|
|
|
|
|
|
|
|
Prior to 0\.7\.2, \fBclose\fR took two parameters: \fIforce\fR and \fItimeout\fR\.
|
|
|
|
\fItimeout\fR was the number of seconds before \fIforce\fR took effect (default,
|
|
|
|
30), and \fIforce\fR determined whether the result was a unilateral close or
|
|
|
|
an RPC error (default)\. Even after the timeout, the channel would be
|
|
|
|
closed if the peer reconnected\.
|
|
|
|
|
|
|
|
.SH RETURN VALUE
|
|
|
|
|
|
|
|
On success, an object with fields \fItx\fR and \fItxid\fR containing the closing
|
|
|
|
transaction are returned\. It will also have a field \fItype\fR which is
|
|
|
|
either the JSON string \fImutual\fR or the JSON string \fIunilateral\fR\. A
|
|
|
|
\fImutual\fR close means that we could negotiate a close with the peer,
|
|
|
|
while a \fIunilateral\fR close means that the \fIforce\fR flag was set and we
|
|
|
|
had to close the channel without waiting for the counterparty\.
|
|
|
|
|
|
|
|
|
|
|
|
A unilateral close may still occur at any time if the peer did not
|
|
|
|
behave correctly during the close negotiation\.
|
|
|
|
|
|
|
|
|
|
|
|
Unilateral closes will return your funds after a delay\. The delay will
|
|
|
|
vary based on the peer \fIto_self_delay\fR setting, not your own setting\.
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
2019-08-31 14:30:56 +02:00
|
|
|
ZmnSCPxj \fI<ZmnSCPxj@protonmail.com\fR> is mainly responsible\.
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
|
|
\fBlightning-disconnect\fR(7), \fBlightning-fundchannel\fR(7)
|
|
|
|
|
|
|
|
.SH RESOURCES
|
|
|
|
|
2019-08-31 14:30:56 +02:00
|
|
|
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
|
2019-08-10 02:12:44 +02:00
|
|
|
|