pull down to refresh
221 sats \ 0 replies \ @C_Otto 23 Mar \ on: Why is a sweep transaction needed when force closing lightning
Here's a good blog series that explains the details: https://ellemouton.com/posts/htlc-deep-dive/
If you forward some HTLC and the outgoing channel is force-closed, your peer may claim those funds only by revealing the pre-image. If this happens after the timeout and if you didn't sweep the HTLC funds by then, this is still possible. However, if you forwarded the HTLC and failed the HTLC back upstream (towards the sender), you effectively lost the HTLC amount. To avoid this, you should sweep the HTLC funds as soon as they time out.
However, in other situations (when you're receiving HTLCs, or when looking at the non-HTLC funds in a channel) there isn't a pressing need to sweep the funds. In fact, I patched my lnd to avoid costly sweep transactions. This isn't necessary anymore, as lnd now uses a better approach to sweeping (slowly ramping up the fees, taking the associated risk into consideration).