lightning-dev-forget-channel

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. OR No 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"="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"
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.