How to close stale lightning channels with c-lightning

0

I was running a lightning node using c-lightning about 9 months ago. Unfortunately the server was shutdown while a few channels were open.

I have restarted the server and updated c-lightning to the latest version (0.6.3). After restarting both bitcoind and lightningd I am left with the 2 stale channels.

zap:~# lightning/cli/lightning-cli listpeers
{
  "peers": [
    {
      "connected": false, 
      "channels": [
        {
          "state": "CHANNELD_NORMAL",
          ...
          "status": [
            "CHANNELD_NORMAL:Attempting to reconnect"
          ],
          ...
        }
      ]
    }, 
    {
      "connected": false, 
      "channels": [
        {
          "state": "CHANNELD_NORMAL",
          ...
          "status": [
            "CHANNELD_NORMAL:Attempting to reconnect"
          ], 
          ...
        }
      ]
    }, 
  ]
}

I am unable to connect back to these pairs using lightning/cli/lightning-cli connect x, when I try I get timeout or route errors. (EDIT: which means the other nodes are now down).

askmike

Posted 2019-02-12T11:07:54.997

Reputation: 206

Answers

1

The problem seems that the other nodes are also offline which is why you can't connect to them.

Luckily you don't have to be connected as you can do a force close by publishing your channel state to the Bitcoin network (the disadvantage is that you have to wait for the timelock until you can spend your outputs)

Just try lightning-cli close ENTER-CHANNEL-ID-HERE in case you are not connected your node should perform a force close

Rene Pickhardt

Posted 2019-02-12T11:07:54.997

Reputation: 6 565

Am I at risk of losing any money if they aren't actually down (but pretending to be)? My node should have the latest channelstate since it was unlikely the server went down midst transaction.askmike 2019-02-12T12:16:43.433

If your node was offline there can't be a newer state and you should not loose funds by doing a force close (your onchain fees are a little bit higher than in the mutual close setting) of course I can't guarantee you this outcome as it is not sure clear if there wasn't something else going on but mentioned in your question or not observedRene Pickhardt 2019-02-13T09:46:39.930

1Unfortunately that command errors with { "code" : -1, "message" : "Channel close negotiation not finished before timeout" }, indicating that closing this way requires the other nodes (who are now down).askmike 2019-02-14T10:17:40.617

1Figured out I can pass a true param to force close it. My node now published the tx. Thanks!askmike 2019-02-14T10:27:55.487