LIGHTNING-LISTCLOSEDCHANNELS(7)
π LIGHTNING-LISTCLOSEDCHANNELS π
okay so bestie, this is a lightning-listclosedchannels page β it's a manual page from Core Lightning, and it's lowkey the receipts-finder for your dead channels π
β¨ NAME β¨
listclosedchannels β get data on our closed historical channels π
π¦ SYNOPSIS π¦
listclosedchannels [id]
πΈ DESCRIPTION πΈ
Bestie, this command was added in v23.05 β
The listclosedchannels RPC command returns data on channels which are otherwise forgotten β and by forgotten we mean more than 100 blocks after they're completely resolved onchain, so like, fully gone-gone, moved on, deleted from the group chat π
id(pubkey, optional) β if no id is supplied, then channel data on all historical channels are given. Supplying id will filter the results to only match channels to that peer β¨ Note that prior to v23.05, old peers were forgotten π
π RETURN VALUE π
On success, an object containing closedchannels is returned. It is an array of objects, where each object contains:
channel_id(hash) β the fullchannel_id(funding txid Xored with output number) π₯opener(string) (one of"local","remote") β who initiated the channelprivate(boolean) β if True, we will not announce this channel π€«total_local_commitments(u64) β number of commitment transaction we madetotal_remote_commitments(u64) β number of commitment transaction they madetotal_htlcs_sent(u64) β number of HTLCs we ever sentfunding_txid(txid) β ID of the funding transactionfunding_outnum(u32) β the 0-based output number of the funding transaction which opens the channelfunding_withheld(boolean) β True if we have not broadcast the funding transaction (seefundchannel_complete). (added v25.12) π«Άleased(boolean) β whether this channel was leased from openertotal_msat(msat) β total amount in the channelfinal_to_us_msat(msat) β our balance in final commitment transactionmin_to_us_msat(msat) β least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain πmax_to_us_msat(msat) β most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get π₯close_cause(string) (one of"unknown","local","user","remote","protocol","onchain") β what caused the channel to closepeer_id(pubkey, optional) β peer public key (can be missing with pre-v23.05 closes!) πshort_channel_id(short_channel_id, optional) β theshort_channel_idalias(object, optional):local(short_channel_id, optional) β an alias assigned by this node to this channel, used for outgoing payments β¨remote(short_channel_id, optional) β an alias assigned by the remote node to this channel, usable in routehints and invoices π
closer(string, optional) (one of"local","remote") β who initiated the channel close (only present if closing)channel_type(object, optional) βchannel_typeas negotiated with peer.:bits(array of u32s) β each bit set in thischannel_type.:- (u32, optional) β bit number
names(array of strings) β feature name for each bit set in thischannel_type. Note thatanchors_zero_fee_htlc_txis a deprecated synonym foranchors.:- (string, optional) (one of
"static_remotekey/even","anchor_outputs/even","anchors/even","anchors_zero_fee_htlc_tx/even","scid_alias/even","zeroconf/even") β name of feature bit
funding_psbt(string, optional) β the PSBT (may be non-final or unsigned) we should use to open the channel, if any (added v25.12) πfunding_fee_paid_msat(msat, optional) β how much we paid to lease the channel (iffleasedis true andopeneris local)funding_fee_rcvd_msat(msat, optional) β how much they paid to lease the channel (iffleasedis true andopeneris remote)funding_pushed_msat(msat, optional) β how much opener pushed immediate (if non-zero)last_commitment_txid(hash, optional) β the final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0 πlast_commitment_fee_msat(msat, optional) β the fee onlast_commitment_txidlast_stable_connection(u64, optional) β last time we reestablished the open channel and stayed connected for 1 minute. (added v24.02) β
π ERRORS π
On error the returned object will contain code and message properties, with code being one of the following:
-32602β if the given parameters are wrong π«
π§ AUTHOR π§
Rusty Russell rusty@blockstream.com. π
π SEE ALSO π
π RESOURCES π
Main web site: https://github.com/ElementsProject/lightning β go be nosy bestie π
π EXAMPLES π
Example 1:
Request:
$ lightning-cli listclosedchannels
{
"id": "example:listclosedchannels#1",
"method": "listclosedchannels",
"params": {}
}
Response:
{
"closedchannels": [
{
"peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
"channel_id": "channelid0230000230000230000230000230000230000230000230000230000",
"short_channel_id": "111x1x1",
"alias": {
"local": "121x131x141",
"remote": "151x161x171"
},
"opener": "local",
"closer": "local",
"private": false,
"channel_type": {
"bits": [
12,
22
],
"names": [
"static_remotekey/even",
"anchors/even"
]
},
"total_local_commitments": 16,
"total_remote_commitments": 16,
"total_htlcs_sent": 8,
"funding_txid": "fundingtxid00202020202020202020202020202020202020202020202020202",
"funding_outnum": 1,
"leased": false,
"total_msat": 1000000000,
"final_to_us_msat": 489809898,
"min_to_us_msat": 489809898,
"max_to_us_msat": 1000000000,
"last_commitment_txid": "txidcloselastcommitment00000100001000010000100001000010000100001",
"last_commitment_fee_msat": 2895000,
"close_cause": "user",
"last_stable_connection": 1738500000
},
{
"peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
"channel_id": "channelid0250000250000250000250000250000250000250000250000250000",
"short_channel_id": "115x1x1",
"alias": {
"local": "122x132x142",
"remote": "152x162x172"
},
"opener": "local",
"closer": "local",
"private": true,
"channel_type": {
"bits": [
12,
22
],
"names": [
"static_remotekey/even",
"anchors/even"
]
},
"total_local_commitments": 2,
"total_remote_commitments": 2,
"total_htlcs_sent": 1,
"funding_txid": "fundingtxid00101010101010101010101010101010101010101010101010101",
"funding_outnum": 1,
"leased": false,
"total_msat": 1000000000,
"final_to_us_msat": 500000000,
"min_to_us_msat": 500000000,
"max_to_us_msat": 1000000000,
"last_commitment_txid": "txidcloselastcommitment00000200002000020000200002000020000200002",
"last_commitment_fee_msat": 2896000,
"close_cause": "user",
"last_stable_connection": 1738500000
}
]
}
and that's the whole page bestie, no cap π this one's from Core Lightning v26.06.9 β go forth and dig up your closed channel lore πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms