"title":"Get data on our closed historical channels",
"description":[
"The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)."
],
"request":{
"required":[],
"properties":{
"id":{
"type":"pubkey",
"description":[
"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."
]
}
}
},
"response":{
"required":[
"closedchannels"
],
"properties":{
"closedchannels":{
"type":"array",
"items":{
"type":"object",
"additionalProperties":true,
"required":[
"channel_id",
"opener",
"private",
"total_msat",
"total_local_commitments",
"total_remote_commitments",
"total_htlcs_sent",
"funding_txid",
"funding_outnum",
"leased",
"final_to_us_msat",
"min_to_us_msat",
"max_to_us_msat",
"close_cause"
],
"properties":{
"peer_id":{
"type":"pubkey",
"description":[
"Peer public key (can be missing with pre-v23.05 closes!)."
]
},
"channel_id":{
"type":"hash",
"description":[
"The full channel_id (funding txid Xored with output number)."
]
},
"short_channel_id":{
"type":"short_channel_id",
"description":[
"The short_channel_id."
]
},
"alias":{
"type":"object",
"required":[],
"properties":{
"local":{
"type":"short_channel_id",
"description":[
"An alias assigned by this node to this channel, used for outgoing payments."
]
},
"remote":{
"type":"short_channel_id",
"description":[
"An alias assigned by the remote node to this channel, usable in routehints and invoices."
]
}
}
},
"opener":{
"type":"string",
"enum":[
"local",
"remote"
],
"description":[
"Who initiated the channel."
]
},
"closer":{
"type":"string",
"enum":[
"local",
"remote"
],
"description":[
"Who initiated the channel close (only present if closing)."