Skip to content

Commit 742ae60

Browse files
committed
Allow setting ChannelConfig in OpenChannel
1 parent fc72f57 commit 742ae60

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

protos/src/proto/ldk_node_server.proto

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,60 @@ message OpenChannelRequest {
161161
// The amount of satoshis to push to the remote side as part of the initial commitment state.
162162
optional uint64 push_to_counterparty_msat = 4;
163163

164+
// The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used.
165+
optional ChannelConfig channel_config = 5;
166+
164167
// Whether the channel should be public.
165-
bool announce_channel = 5;
168+
bool announce_channel = 6;
166169
}
167170

168171
message OpenChannelResponse {
169172

170173
// The channel id of the created channel that user can use to refer to channel.
171174
bytes user_channel_id = 1;
172175
}
176+
177+
// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
178+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html
179+
message ChannelConfig {
180+
// Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
181+
// over the channel.
182+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.forwarding_fee_proportional_millionths
183+
uint32 forwarding_fee_proportional_millionths = 1;
184+
185+
// Amount (in milli-satoshi) charged for payments forwarded outbound over the channel,
186+
// in excess of forwarding_fee_proportional_millionths.
187+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.forwarding_fee_base_msat
188+
uint32 forwarding_fee_base_msat = 2;
189+
190+
// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded
191+
// over the channel this config applies to.
192+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.cltv_expiry_delta
193+
uint32 cltv_expiry_delta = 3;
194+
195+
// The maximum additional fee we’re willing to pay to avoid waiting for the counterparty’s
196+
// to_self_delay to reclaim funds.
197+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.force_close_avoidance_max_fee_satoshis
198+
uint64 force_close_avoidance_max_fee_satoshis = 4;
199+
200+
// If set, allows this channel’s counterparty to skim an additional fee off this node’s
201+
// inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
202+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.accept_underpaying_htlcs
203+
bool accept_underpaying_htlcs = 5;
204+
205+
// Limit our total exposure to potential loss to on-chain fees on close, including
206+
// in-flight HTLCs which are burned to fees as they are too small to claim on-chain
207+
// and fees on commitment transaction(s) broadcasted by our counterparty in excess of
208+
// our own fee estimate.
209+
// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.max_dust_htlc_exposure
210+
oneof max_dust_htlc_exposure {
211+
212+
// This sets a fixed limit on the total dust exposure in millisatoshis.
213+
// See more: https://docs.rs/lightning/latest/lightning/util/config/enum.MaxDustHTLCExposure.html#variant.FixedLimitMsat
214+
uint64 fixed_limit_msat = 6;
215+
216+
// This sets a multiplier on the ConfirmationTarget::OnChainSweep feerate (in sats/KW) to determine the maximum allowed dust exposure.
217+
// See more: https://docs.rs/lightning/latest/lightning/util/config/enum.MaxDustHTLCExposure.html#variant.FeeRateMultiplier
218+
uint64 fee_rate_multiplier = 7;
219+
}
220+
}

0 commit comments

Comments
 (0)