lnd
lnd copied to clipboard
contractcourt+routing: create optional runtime config to never go to chain for purely outbound HTLCs
Today, if we make an outgoing payment, and it never gets canceled back, we'll eventually try to go on chain to claim the HTLC ourselves. This makes sense to do in most scenarios (*), but if this is a "leaf node" or the outgoing HTLC was created by our node, then we aren't at risk at all if we don't go to chain ASAP. Instead, we can just leave the HTLC on the commitment transaction, maybe it gets cancelled back. If not, we do have the opportunity cost of not being able to use that suspended HTLC amount for further payments. At a certain point, our slots might full up, so we'd be forced to do so.
Steps To Completion
-
[ ] Add new config option detailed above.
-
[ ] Update the
ChannelArb
to indirectly have access to the switch's circuit map state. -
[ ] Use that new state within the
shouldGoToChain
function to defer going to chain if the HTLC has expired, but it's a pure outgoing HTLC (the incoming key in the circuit map is all zeroes).
Maybe we could aim this for 0.19
along with #1226?
This would massively improve the UX for mobile LND users