Skip to content

Instantly share code, notes, and snippets.

@zerofeerouting
Last active July 23, 2022 10:39
Show Gist options
  • Save zerofeerouting/ab5f4b2f98783447f993a78936576e23 to your computer and use it in GitHub Desktop.
Save zerofeerouting/ab5f4b2f98783447f993a78936576e23 to your computer and use it in GitHub Desktop.
Common reasons for force-closes

Why did our channel get force-closed?

There are a bunch of possible reasons for a force close - I will elaborate on the most common ones.

⚠ This is a work in progress and will get expanded.

1. Stuck HTLC timed out

WHAT HAPPENED?
An HTLC (a lightning transaction) timed out, which means it did neither succeed in arriving at it's destination, nor was it possible to rewind it. This results in the node force-closing the channel to keep the funds safe.

CAUSE:
This is usually caused a peers prolongued downtime. This could be either caused by the node being down, or by the node being a TOR only node and losing the connection.

HOW TO AVOID:
There is little one can do, other than avoiding downtime and getting a clearnet address (which has it's own set of pros and cons).

ℹ This is the number one reason for force-closes in my experience.

2. Your node sent internal error

WHAT HAPPENED?
At some point your node sent error channel [channel_id]: internal error to mine, which caused my node to close the channel to you in order to rescue your funds.

CAUSE:
As far as I can tell at the moment, this is caused by a bug in LND (lightningnetwork/lnd#6485).

There is also this issue: lightningnetwork/lnd#6593 that I opened.

HOW TO AVOID:

The peer that I had the issue with was heavily rebalancing. A couple of minutes before the internal error their node had memory issues (due to rebalancing) and restarted. You might want to reduce the intensity of your rebalancing.

3. More than 14 days downtime

WHAT HAPPENED?
I force-closed the channel due to the other node being a zombie.

CAUSE:
Your node is not connected to mine and hasn't sent an update on the graph for more than 14 days. I have to assume the node no longer exists.

HOW TO AVOID:
Make sure your node is up and running and connected to me.

ℹ I have not yet closed a channel due to this reason.

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