lightning-listhtlcs

lightning-listhtlcs -- Command for querying HTLCs

SYNOPSIS

listhtlcs [id]

DESCRIPTION

The listhtlcs RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago).

  • id (string, optional): A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known).

RETURN VALUE

On success, an object containing htlcs is returned. It is an array of objects, where each object contains:

  • short_channel_id (short_channel_id): The channel that contains/contained the HTLC.
  • id (u64): The unique, incrementing HTLC id the creator gave this.
  • expiry (u32): The block number where this HTLC expires/expired.
  • amount_msat (msat): The value of the HTLC.
  • direction (string) (one of "out", "in"): Out if we offered this to the peer, in if they offered it.
  • payment_hash (hash): Payment hash sought by HTLC.
  • state (string) (one of "SENT_ADD_HTLC", "SENT_ADD_COMMIT", "RCVD_ADD_REVOCATION", "RCVD_ADD_ACK_COMMIT", "SENT_ADD_ACK_REVOCATION", "RCVD_REMOVE_HTLC", "RCVD_REMOVE_COMMIT", "SENT_REMOVE_REVOCATION", "SENT_REMOVE_ACK_COMMIT", "RCVD_REMOVE_ACK_REVOCATION", "RCVD_ADD_HTLC", "RCVD_ADD_COMMIT", "SENT_ADD_REVOCATION", "SENT_ADD_ACK_COMMIT", "RCVD_ADD_ACK_REVOCATION", "SENT_REMOVE_HTLC", "SENT_REMOVE_COMMIT", "RCVD_REMOVE_REVOCATION", "RCVD_REMOVE_ACK_COMMIT", "SENT_REMOVE_ACK_REVOCATION"): The first 10 states are for in, the next 10 are for out.

AUTHOR

Rusty Russell <[email protected]> is mainly responsible.

SEE ALSO

lightning-listforwards(7)

RESOURCES

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

EXAMPLES

Example 1:

Request:

lightning-cli listhtlcs "109x1x1"
{
  "id": "example:listhtlcs#1",
  "method": "listhtlcs",
  "params": [
    "109x1x1"
  ]
}

Response:

{
  "htlcs": [
    {
      "short_channel_id": "109x1x1",
      "id": 0,
      "expiry": 126,
      "direction": "out",
      "amount_msat": 500000000,
      "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 1,
      "expiry": 136,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 2,
      "expiry": 149,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 3,
      "expiry": 155,
      "direction": "out",
      "amount_msat": 10000202,
      "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 4,
      "expiry": 152,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    }
  ]
}

Example 2:

Request:

lightning-cli listhtlcs
{
  "id": "example:listhtlcs#2",
  "method": "listhtlcs",
  "params": {}
}

Response:

{
  "htlcs": [
    {
      "short_channel_id": "109x1x1",
      "id": 0,
      "expiry": 126,
      "direction": "out",
      "amount_msat": 500000000,
      "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 1,
      "expiry": 136,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 2,
      "expiry": 149,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 3,
      "expiry": 155,
      "direction": "out",
      "amount_msat": 10000202,
      "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    },
    {
      "short_channel_id": "109x1x1",
      "id": 4,
      "expiry": 152,
      "direction": "out",
      "amount_msat": 10001,
      "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
      "state": "RCVD_REMOVE_ACK_REVOCATION"
    }
  ]
}

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.