What do Pending HTLC stages mean? #7704
-
I had a very expensive force close recently, and in trying to understand what happened I found out that pending HTLCs in the force close have "stages" attributed to them. This can be seen from the output of Can anyone help me understand what the stages mean? Why do HTLCs need to be swept on chain two (2) times before it ends up being usable? Once to get it from stage 1 to stage 2, and another time to end up in lnd's Aezeed wallet keyspace. From what I understand from the spec, once the HTLC UTXO expires, it should be immediately under your control, and you should be able to immediately sweep it into an address you control. Why the intermediate step? Is this an lnd-only behaviour, or do other implementations do the same? Please help me understand. Apologies if I sound agitated, I am just really disheartened by this very very expensive force close. Felt like giving up and just keep my sats on chain. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The two stages for sweeping HTLCs are a safety mechanism described in the spec. Going on-chain to resolve an HTLC is always painful, especially in this high fee environment. But the main objective of |
Beta Was this translation helpful? Give feedback.
for any output on the remote commitment tx that belongs to you - you wont require a second level tx. The second level tx is only ever for the side that owns that commitment tx. So for both outgoing and incoming HTLCs on your (the local party) commitment tx, you will need to go to a second level state to get the timeout/success. But any output that belongs to you on the remote party's commitment tx, you can just sweep directly (after the 1 block CSV if it is an anchor output)