LIGHTNING-DEV-FORGET-CHANNEL(7)
π LIGHTNING-DEV-FORGET-CHANNEL β dev-forget-channel(7)
okay bestie, so before we even start: this is the dev-forget-channel page from the Core Lightning docs, and it's about a command that yeets a channel's DB entries out of the database after a close. advanced-users-only energy, fr fr. buckle up π
β¨ NAME β¨
dev-forget-channel β the command that removes the DB entries from the database after a close. literally what the name says, no cap π«Ά
πΈ SYNOPSIS πΈ
β οΈ WARNING: For advanced users only β οΈ
dev-forget-channel id [short_channel_id] [channel_id] [force]
π¦ DESCRIPTION π¦
okay so listen. Never use any dev command β including this one β unless you know exactly what you're doing, and you've checked with a developer that your understanding is actually correct. these things are meant only as a means of last resort and they have the potential to mess things up. you have been warnedβοΈ like, genuinely. i'm not being cute about this one π
dev-forget-channel forgets the channel with the given details. it does some extra checks first on whether it's safe to forget the channel, and only then does it remove the channel from the DB. also note: this command is only available if CLN was started with --developer. no flag, no command, sorry bestie π
also see https://docs.corelightning.org/docs/faq#how-to-forget-about-a-channel (the FAQ has the lore, iykyk)
so here's the parameters, one by one π
id(pubkey) β the peer id of the channel to be forgotten. it 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 removechannel_id(hash, optional) β the channel id of the channel you want to removeforce(boolean, optional) β ignores the UTXO check for forced removal. the default isFalse
π RETURN VALUE π
on success, an object comes back containing:
forced(boolean) β if the command was forced or notfunding_unspent(boolean) β the funding is spent or not in the channelfunding_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 rusty@rustcorp.com.au is mainly responsible. iconic behavior honestly β
π 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"="nodeid050505050505050505050505050505050505050505050505050505050505"
{
"id": "example:dev-forget-channel#1",
"method": "dev-forget-channel",
"params": {
"id": "nodeid050505050505050505050505050505050505050505050505050505050505"
}
}
Response:
{
"forced": false,
"funding_unspent": false,
"funding_txid": "fundingtxid00101010101010101010101010101010101010101010101010101"
}
Example 2: Forget a channel by short channel id when peer has multiple channels
Request:
$ lightning-cli dev-forget-channel -k "id"="nodeid030303030303030303030303030303030303030303030303030303030303" "short_channel_id"="111x1x1" "force"=True
{
"id": "example:dev-forget-channel#2",
"method": "dev-forget-channel",
"params": {
"id": "nodeid030303030303030303030303030303030303030303030303030303030303",
"short_channel_id": "111x1x1",
"force": true
}
}
Response:
{
"forced": true,
"funding_unspent": false,
"funding_txid": "fundingtxid00202020202020202020202020202020202020202020202020202"
}
k that's the whole page bestie, mwah π this was Core Lightning v26.06.9 β go forth and please, for the love of everything, check with a dev first π«Άβ¨
π¦ 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