I think I have a general understanding of how the Lightning Network works. However, I was having a little difficulty in understanding what happens when a node in the middle of a "path" suddenly goes dormant, or offline for a long time. To clarify my question, consider the following example:
- A wants to make a payment of 1 BTC to D.
- A finds a path from A --> B --> C --> D.
- D generates an R and sends H = hash(R) to A
- A creates HTLC of 1.002 BTC with B.
- B creates HTLC of 1.001 BTC with C.
- C creates HTLC of 1 BTC with D.
- D unlocks HTLC, receives 1 BTC, and then tells R to C.
However, what if C is suddenly offline meaning C won't be there to receive R from D and thus stops the flow of R back through the path. I would assume that the HTLC's between A and B and B and C run out and so A and B are refunded.
So, would C lose out? Would A have just made a "free" transaction? I assume this is a fast process, but is it likely such an event occurs where a middle node in an LN transaction just goes down for a long while?