graceful

graceful -- Command to prepare Core Lightning node for stopping.

SYNOPSIS

graceful [timeout]

DESCRIPTION

Command added in v26.06.

graceful is a RPC command to prevent further htlcs, and disconnect all idle peers. It returns when all HTLCs are complete, and all peers disconnected: then you can shutdown. It also sends notifications about HTLC expiry, so you can judge how long it is safe to be offline.
With a timeout, it always returns after that many seconds: if any peer connections or HTLCs are still pending, those are returned. An empty response means nothing is pending

  • timeout (u32, optional): If set, the graceful command will return after this time even if not all HTLCs have terminated. Useful for scripting, where you may want to follow with stop.

RETURN VALUE

On success, an object is returned, containing:

  • pending_htlc_expiries (array of u32s, optional): The (sorted) expiry blockheights of all HTLCs which are not resolved:
    • (u32, optional)
  • pending_peers (array of pubkeys, optional): Any peers still connected (presumably because they have outstanding HTLCs):
    • (pubkey, optional)

AUTHOR

Rusty Russell [email protected] is mainly responsible.

SEE ALSO

lightning-stop(7)

RESOURCES

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

EXAMPLES

Example 1:

Request:

lightning-cli graceful
{
  "id": "example:graceful#1",
  "method": "graceful",
  "params": {}
}

Response:

{}

Core Lightning is Blockstream's open-source implementation of the Lightning Network optimised for performance. It is highly customizable through modular expandability.

© 2026 Core Lightning, a Blockstream project.
All rights reserved.

X Twitter Logo Streamline Icon: https://streamlinehq.com

X

The official Core Lightning X(Twitter) handle to follow project updates and announcements.

Github Logo 2 Streamline Icon: https://streamlinehq.com

Github

Github repository for source code, issues, and contributions. Visit our project here to explore or contibute.

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/V6ay9yNhBQ to join.