Update and rename 13_6_Close_Channel.md to 13_6_Closing_a_Channel.md

This commit is contained in:
Javier Vargas 2020-07-28 12:34:09 +02:00 committed by GitHub
parent 2703b55a9e
commit 81ecdbc695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 11 deletions

View File

@ -1,11 +0,0 @@
# 13.6: Close channel
> :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning.
In this chapter you'll be able to close a channel and learn what it means and how to do it using `lightning-cli close` command-line interface. The close RPC command attempts to close the channel cooperatively with the peer, or unilaterally after unilateraltimeout argument expires measured in seconds and the output will be sent to the address controlled by your c-lightning wallet if you don't specify one.
### Channel close
Close a channel means you and your counterparty will send their agreed-upon channel balance to the blockchain whereby you must pay transaction fees and must wait for the transaction to be mined.

48
13_6_Closing_a_Channel.md Normal file
View File

@ -0,0 +1,48 @@
# 13.6: Closing a Channel
> :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning.
In this chapter you'll be able to close a channel and learn what it means and how to do it using `lightning-cli close` command-line interface. The close RPC command attempts to close the channel cooperatively with the peer, or unilaterally after unilateraltimeout argument expires measured in seconds and the output will be sent to the address controlled by your c-lightning wallet if you don't specify one.
Close a channel means you and your counterparty will send their agreed-upon channel balance to the blockchain whereby you must pay transaction fees and must wait for the transaction to be mined.
### Listing your channels.
You can use the `lightning-cli listfunds` command to see your channels. This RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels.
```
c$ lightning-cli --network=testnet listfunds
{
"outputs": [
{
"txid": "9843c037f54a4660b297a9f2454e11d26d8659f084a284a5740bb15cb1d97aa6",
"output": 0,
"value": 19238,
"amount_msat": "19238000msat",
"scriptpubkey": "0014aa572371f29310cd677d039cdcd054156c1a9545",
"address": "tb1q4ftjxu0jjvgv6emaqwwde5z5z4kp49299gmdpd",
"status": "confirmed",
"blockheight": 1780768,
"reserved": false
}
],
"channels": [
{
"peer_id": "0302d48972ba7eef8b40696102ad114090fd4c146e381f18c7932a2a1d73566f84",
"connected": false,
"state": "CHANNELD_NORMAL",
"short_channel_id": "1780768x12x1",
"channel_sat": 180000,
"our_amount_msat": "180000000msat",
"channel_total_sat": 280000,
"amount_msat": "280000000msat",
"funding_txid": "9843c037f54a4660b297a9f2454e11d26d8659f084a284a5740bb15cb1d97aa6",
"funding_output": 1
}
]
}
```
### Closing a channel
You should use `lightning-cli close` command to close the channel. This RPC command attempts to close the channel cooperatively with the peer, or unilaterally after unilateraltimeout expires, and the to-local output will be sent to the address specified in destination.