LIGHTNING-DEV-FORGET-CHANNEL(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… 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 remove
  • channel_id (hash, optional) β€” the channel id of the channel you want to remove
  • force (boolean, optional) β€” ignores the UTXO check for forced removal. the default is False

πŸ’– RETURN VALUE πŸ’–

on success, an object comes back 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. OR No 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