LIGHTNING-FUNDCHANNEL_CANCEL(7)

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

πŸ’… LIGHTNING-FUNDCHANNEL_CANCEL(7) β€” the manual page, bestie edition

okay so this is the page for lightning-fundchannel_cancel(7), and ngl it's a whole vibe: it's the "jk never mind" of channel opening. let's get into it ✨


🌸 NAME 🌸

fundchannel_cancel β€” the command for completing channel establishment (yes literally that's what the original says and yes it's a little ironic given what this command does πŸ’€)


πŸŽ€ SYNOPSIS πŸŽ€

fundchannel_cancel id

that's it. one argument. slay.


πŸ’– DESCRIPTION πŸ’–

okay so fundchannel_cancel is a lower level RPC command. lowkey the whole point: it lets the channel opener cancel a channel before funding broadcast, with a peer they're already connected to. think of it as the "let me just ghost this draft" button πŸ¦‹

⚠️ huge warning, no cap: the funding transaction MUST NOT be broadcast before fundchannel_cancel. broadcasting the transaction before fundchannel_cancel WILL lead to unrecoverable loss of funds. like, not "oops" loss. unrecoverable loss. do not do this. periodt. πŸ”₯

also important, bestie: if fundchannel_cancel is called after fundchannel_complete, the remote peer may disconnect when the command succeeds. in this case, you (the user) need to connect to the remote peer again before opening a channel. so it's giving "breakup, but you'll have to text them first next time" 😭

here's the one and only arg:

  • id (pubkey) β€” the Node id of the remote peer you're cancelling with. that's the whole thing. 🌈

✨ RETURN VALUE ✨

on success, an object is returned, containing:

  • cancelled (string) β€” a message indicating it was cancelled by RPC. cute little confirmation, iykyk πŸ’…

πŸ’€ ERRORS πŸ’€

on error the returned object will contain code and message properties, with code being one of the following:

  • -32602 β€” if the given parameters are wrong. classic. πŸ™ˆ
  • 306 β€” Unknown peer id. who even are they.
  • 307 β€” No channel currently being funded that can be cancelled. nothing to cancel, bestie, the draft doesn't exist.
  • 308 β€” It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us. 🚨 read that one twice fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

Lisa Neigut niftynei@gmail.com is mainly responsible. iconic behavior, we stan. 🫢


🧚 SEE ALSO 🧚


⭐ RESOURCES ⭐

Main web site: https://github.com/ElementsProject/lightning


πŸ“ EXAMPLES πŸ“

Example 1:

Request:

$ lightning-cli fundchannel_cancel "nodeid101010101010101010101010101010101010101010101010101010101010"

{
  "id": "example:fundchannel_cancel#1",
  "method": "fundchannel_cancel",
  "params": [
    "nodeid101010101010101010101010101010101010101010101010101010101010"
  ]
}

Response:

{
  "cancelled": "Channel open canceled by RPC"
}

Example 2:

Request:

$ lightning-cli fundchannel_cancel -k "id"="nodeid101010101010101010101010101010101010101010101010101010101010"

{
  "id": "example:fundchannel_cancel#2",
  "method": "fundchannel_cancel",
  "params": {
    "id": "nodeid101010101010101010101010101010101010101010101010101010101010"
  }
}

Response:

{
  "cancelled": "Channel open canceled by RPC"
}

okay that's the whole page, bestie β€” go forth and cancel responsibly, and please please PLEASE don't broadcast that funding tx first πŸ’–

this has been your girl, signing off from Core Lightning v26.06.9 β€” stay slay, stay connected πŸŽ€βœ¨

πŸ“¦ where this page comes from