lightningdevkit / ldk-node

A ready-to-go node implementation built using LDK.
Other
148 stars 78 forks source link

Bump max inflight HTLC value to 100% if we're an LSPS2 client #262

Closed tnull closed 8 months ago

tnull commented 8 months ago

When we're an LSPS2 client, the LSP might open the channel to us with a capacity only barely more than the initial payment size. We therefore need to be able to receive close to 100% of the channel size in a single HTLC.

Here we therefore bump the default max HTLC value inflight config to 100%. We should eventually be able to set this on a per-channel basis, but for now we just bump or default for all channels.

tnull commented 8 months ago

Force pushed with the following change:

diff --git a/src/builder.rs b/src/builder.rs
index cfc6c59..cc0c9ad 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -707,5 +707,5 @@ fn build_with_store_internal<K: KVStore + Sync + Send + 'static>(
                // FIXME: When we're an LSPS2 client, set maximum allowed inbound HTLC value in flight
                // to 100%. We should eventually be able to set this on a per-channel basis, but for
-               // now we just bump or default for all channels.
+               // now we just bump the default for all channels.
                user_config.channel_handshake_config.max_inbound_htlc_value_in_flight_percent_of_channel =
                        100;