lightning-dev-forget-channel -- Command to remove the DB entries from the database after a close
SYNOPSIS
(WARNING: For advanced users only)
dev-forget-channel id [short_channel_id] [channel_id] [force]
DESCRIPTION
Never use any dev
command, including this one, unless you know exactly what you are doing; and have checked with a developer that your understanding is correct. They are meant only as a means of last resort and have the potential to mess things up. You have been warned❗️
The dev-forget-channel forgets the channel with given details. It will perform additional checks on whether it is safe to forget the channel, and only then remove the channel from the DB. Notice that this command is only available if CLN was started with --developer.
Also see https://docs.corelightning.org/docs/faq#how-to-forget-about-a-channel
- id (pubkey): The peer id of the channel to be forgotten. Checks if the channel is still active by checking its funding transaction.
- short_channel_id (short_channel_id, optional): The short channel id of the channel you want to remove.
- channel_id (hash, optional): The channel id of the channel you want to remove.
- force (boolean, optional): Ignores UTXO check for forced removal. The default is False.
RETURN VALUE
On success, an object is returned, containing:
- forced (boolean): If the command was forced or not.
- funding_unspent (boolean): The funding is spent or not in the channel.
- funding_txid (txid): The id of the funding transaction.
ERRORS
The following errors may be reported:
- -32602: If the given parameters are missing or wrong.
- -1: Catch all nonspecific errors, eg.
Multiple channels: please specify short_channel_id.
ORNo channels matching that peer_id and that short_channel_id.
, etc.
AUTHOR
Rusty Russell <[email protected]> is mainly responsible.
SEE ALSO
lightning-close(7), lightning-listchannels(7), lightning-listpeerchannels(7), lightning-listfunds(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1: Forget a channel by peer pubkey when only one channel exists with the peer:
Request:
lightning-cli dev-forget-channel -k "id"="032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e"
{
"id": "example:dev-forget-channel#1",
"method": "dev-forget-channel",
"params": {
"id": "032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e"
}
}
Response:
{
"forced": false,
"funding_unspent": false,
"funding_txid": "c40c9d52aaac47f76c67163a2efc005df189b36b855b0ad209da7d0d066358b1"
}
Example 2: Forget a channel by short channel id when peer has multiple channels:
Request:
lightning-cli dev-forget-channel -k "id"="035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d" "short_channel_id"="111x1x0" "force"=True
{
"id": "example:dev-forget-channel#2",
"method": "dev-forget-channel",
"params": {
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
"short_channel_id": "111x1x0",
"force": true
}
}
Response:
{
"forced": true,
"funding_unspent": false,
"funding_txid": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483"
}