2019-08-31 13:30:56 +01:00
lightning-listchannels -- Command to query active lightning channels in the entire network
==========================================================================================
2019-08-10 00:54:18 +01:00
SYNOPSIS
--------
2022-01-26 17:18:49 +00:00
**listchannels** [*short\_channel\_id*] [*source*] [*destination*]
2019-08-10 00:54:18 +01:00
DESCRIPTION
-----------
The **listchannels** RPC command returns data on channels that are known
to the node. Because channels may be bidirectional, up to 2 objects will
be returned for each channel (one for each direction).
2023-12-13 05:36:19 +00:00
Note that for local channels, listpeerchannels(7) gives much more detailed
information: **listchannels** only shows public gossip information (previously it merged local information, but that was deprecated in *v24.02* ).
2020-03-06 04:41:46 +00:00
If *short\_channel\_id* is a short channel id, then only known channels with a
matching *short\_channel\_id* are returned. Otherwise, it must be null.
2019-08-10 00:54:18 +01:00
2020-03-06 04:41:46 +00:00
If *source* is a node id, then only channels leading from that node id
2019-08-10 00:54:18 +01:00
are returned.
2021-06-22 14:42:39 +01:00
If *destination* is a node id, then only channels leading to that node id
are returned.
2022-04-20 09:08:54 +01:00
Only one of *short\_channel\_id* , *source* or *destination* can be supplied.
2021-06-22 14:42:39 +01:00
If nothing is supplied, data on all lightning channels known to this
2019-08-10 00:54:18 +01:00
node, are returned. These can be local channels or public channels
broadcast on the gossip network.
RETURN VALUE
------------
2021-06-16 02:05:17 +01:00
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **channels** is returned. It is an array of objects, where each object contains:
2022-09-05 22:33:09 +01:00
2021-06-16 02:05:17 +01:00
- **source** (pubkey): the source node
- **destination** (pubkey): the destination node
2022-09-08 02:08:00 +01:00
- **short\_channel\_id** (short\_channel\_id): short channel id of channel
2023-01-30 06:07:03 +00:00
- **direction** (u32): direction (0 if source < destination , 1 otherwise ).
2023-12-13 05:36:19 +00:00
- **public** (boolean): true if this is announced (from *v24.02* , being false is deprecated)
2022-09-05 22:45:06 +01:00
- **amount\_msat** (msat): the total capacity of this channel (always a whole number of satoshis)
- **message\_flags** (u8): as defined by BOLT #7
- **channel\_flags** (u8): as defined by BOLT #7
2023-12-13 05:36:28 +00:00
- **active** (boolean): true unless source has disabled it (or (deprecated in *v24.02* ) it's a local channel and the peer is disconnected or it's still opening or closing)
2022-11-11 02:03:13 +00:00
- **last\_update** (u32): UNIX timestamp on the last channel\_update from *source*
2022-09-05 22:45:06 +01:00
- **base\_fee\_millisatoshi** (u32): Base fee changed by *source* to use this channel
- **fee\_per\_millionth** (u32): Proportional fee changed by *source* to use this channel, in parts-per-million
2021-06-16 02:05:17 +01:00
- **delay** (u32): The number of blocks delay required by *source* to use this channel
2022-09-05 22:45:06 +01:00
- **htlc\_minimum\_msat** (msat): The smallest payment *source* will allow via this channel
2022-07-13 16:45:39 +01:00
- **features** (hex): BOLT #9 features bitmap for this channel
2022-09-05 22:45:06 +01:00
- **htlc\_maximum\_msat** (msat, optional): The largest payment *source* will allow via this channel
2021-09-03 11:07:59 +01:00
2021-06-16 02:05:17 +01:00
[comment]: # (GENERATE-FROM-SCHEMA-END)
2019-08-10 00:54:18 +01:00
2021-06-22 14:42:39 +01:00
If one of *short\_channel\_id* , *source* or *destination* is supplied and no
matching channels are found, a "channels" object with an empty list is returned.
2019-08-10 00:54:18 +01:00
2020-01-07 16:59:24 +00:00
On error the returned object will contain `code` and `message` properties,
with `code` being one of the following:
2019-08-10 00:54:18 +01:00
2020-01-07 16:59:24 +00:00
- -32602: If the given parameters are wrong.
2019-08-10 00:54:18 +01:00
AUTHOR
------
Michael Hawkins < < michael.hawkins @ protonmail . com > >.
SEE ALSO
--------
lightning-fundchannel(7), lightning-listnodes(7)
RESOURCES
---------
Main web site: < https: / / github . com / ElementsProject / lightning >
Lightning RFC site
- BOLT \#7:
2022-09-29 04:49:03 +01:00
< https: / / github . com / lightning / bolts / blob / master / 07-routing-gossip . md >
2020-08-25 02:33:16 +01:00
2023-12-13 05:36:28 +00:00
[comment]: # ( SHA256STAMP:c32fcbcb0d0ba926513978a96e6b68ee9e3d7f732b5a9cc167aa77cdd33d717f)