Skip to content

How to clean up CHANNELD_AWAITING_LOCKIN #1234

Closed

Description

@pooleja

My node was down for a while, and was brought back up yesterday and synced with the latest master. I am noticing a bunch of channels in CHANNELD_AWAITING_LOCKIN state even though they are fully confirmed. Is the proper way to close these and clean them up to call "dev-fail" against them?

Here are two examples where one was created by me and another looks like it was created by someone else:

    {
      "id": "03ee2b2492bdc1b265a5f4a009c8491af33e428f01295385757f2f44bdd3709922",
      "connected": false,
      "channels": [
        {
          "state": "CHANNELD_AWAITING_LOCKIN",
          "short_channel_id": "510206:259:1",
          "funding_txid": "9160bf6ca6544ae6d663bfef62caf0f76bc920d53ca6271a286dfa0b521f490d",
          "msatoshi_to_us": 200000000,
          "msatoshi_total": 200000000,
          "dust_limit_satoshis": 546,
          "max_htlc_value_in_flight_msat": 18446744073709552000,
          "channel_reserve_satoshis": 0,
          "htlc_minimum_msat": 0,
          "their_to_self_delay": 144,
          "our_to_self_delay": 144,
          "to_self_delay": 144,
          "max_accepted_htlcs": 483,
          "status": [
            "Loaded from database"
          ]
        }
      ]
    },
...
    {
      "id": "03e8ba09559f195480ec95d9f233227eb64f60db739238cbcaab92fded35091ac7",
      "connected": false,
      "channels": [
        {
          "state": "CHANNELD_AWAITING_LOCKIN",
          "short_channel_id": "512451:1340:0",
          "funding_txid": "d888f1614ef4625dde2153e7d00cd46f6912425bf71d643d0c11ca511a613e02",
          "msatoshi_to_us": 0,
          "msatoshi_total": 2000000,
          "dust_limit_satoshis": 546,
          "max_htlc_value_in_flight_msat": 18446744073709552000,
          "channel_reserve_satoshis": 0,
          "htlc_minimum_msat": 0,
          "their_to_self_delay": 144,
          "our_to_self_delay": 144,
          "to_self_delay": 144,
          "max_accepted_htlcs": 483,
          "status": [
            "Loaded from database"
          ]
        }
      ]
    },

Activity

  1. ZmnSCPxj commented on Mar 18, 2018

    @ZmnSCPxj
    Contributor

    How long has your node been up? It might not have caught up yet, meaning some waiting period first. The status: ["Loaded from database"] means there is very little that lightningd has decided to do yet.

    If your side has seen the funding transaction confirmed (this is sometimes flaky) then it should also say something like funding_locked: sending commit index %d.

    If the other side has seen the funding transaction confirmed (if this is another c-lightning this is sometims flaky) you should see something like They've confirmed funding, we haven't yet.

    How long has it been since you restarted?

  2. ZmnSCPxj commented on Mar 18, 2018

    @ZmnSCPxj
    Contributor

    lightning-cli getinfo should also show the blockheight that c-lightning has reached. This is not necessarily the same as the blockheight that the bitcoind that c-lightning is using.

  3. pooleja commented on Mar 18, 2018

    @pooleja
    Author

    @ZmnSCPxj it looks like the node and lightningd are both synced.

    $ cli/lightning-cli getinfo | jq
    {
      "id": "0235447c7485ff2b945bac5fbc366d54a87389bab8cacf1b64b26ec01e96bd165a",
      "port": 9735,
      "address": [
        {
          "type": "ipv4",
          "address": "34.236.113.58",
          "port": 9735
        }
      ],
      "version": "v0.5.2-2016-11-21-2347-g4ffd5e2",
      "blockheight": 514010,
      "network": "bitcoin"
    }
    
  4. ZmnSCPxj commented on Mar 18, 2018

    @ZmnSCPxj
    Contributor

    Can you do listpeers again? Is the status in particular the same ["Loaded from database"]?

  5. ZmnSCPxj commented on Mar 18, 2018

    @ZmnSCPxj
    Contributor

    Also, can you try getlog debug?

  6. cdecker commented on Mar 18, 2018

    @cdecker
    Member

    Channels may also stay in that state until they receive the lockin message from the peer. Since the channels you listed are connected: false might I suggest reconnecting to the peers and see if they complete the lockin and move on to become normal?

  7. pooleja commented on Mar 19, 2018

    @pooleja
    Author

    Latest listpeers still shows CHANNELD_AWAITING_LOCKIN and "Loaded from database".

    From debug output:

    { "type" : "DEBUG", "time" : "20.187143520", "source" : "lightning_gossipd(1342):", "log" : "Failed connected out for 03ee2b2492bdc1b265a5f4a009c8491af33e428f01295385757f2f44bdd3709922, will try again" },
    

    Trying to re-connect:

    $ cli/lightning-cli connect 03ee2b2492bdc1b265a5f4a009c8491af33e428f01295385757f2f44bdd3709922 109.70.3.226
    { "code" : -1, "message" : "Could not connect to 03ee2b2492bdc1b265a5f4a009c8491af33e428f01295385757f2f44bdd3709922 after 46 seconds and 10 attempts" }
    

    The node related to the incoming one above is not broadcasting their URI so I can't try this... which brings me back to the question "how can I clean these up"? Should I run dev-fail on them? Will this recover funds in the channel?

    Thanks!

  8. ZmnSCPxj commented on Mar 19, 2018

    @ZmnSCPxj
    Contributor

    The node related to the incoming one above is not broadcasting their URI so I can't try this... which brings me back to the question "how can I clean these up"? Should I run dev-fail on them? Will this recover funds in the channel?

    Not bother? All the money is on the other side, not ours (msatoshi_to_us = 0). If you really want to (e.g. the other side might have utterly destroyed its channel data and is waiting for you to clean it up for them because they cannot do so themselves) you can use dev-fail. But there is always the possibility that they come back online and route through you, none of your money is tied up on that channel, so it is no loss to you to keep the channel alive.

  9. pooleja commented on Mar 19, 2018

    @pooleja
    Author

    @ZmnSCPxj thanks. Makes sense about the incoming channel.

    What about the channel where I do have funds locked in? If I do want to close it out and recover the funds, what is the best way to handle that?

  10. ZmnSCPxj commented on Mar 19, 2018

    @ZmnSCPxj
    Contributor

    I think dev-fail? But see #1161. Possibly we do not have a good way to force a unilateral close yet.

  11. pooleja commented on Mar 19, 2018

    @pooleja
    Author

    OK thanks. I will close this issue and watch #1161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions