@@ -237,6 +237,41 @@ pub struct CommonOpenChannelFields {
237237 pub channel_type : Option < ChannelTypeFeatures > ,
238238}
239239
240+ impl CommonOpenChannelFields {
241+ /// The [`ChannelParameters`] for this channel.
242+ pub fn channel_parameters ( & self ) -> ChannelParameters {
243+ ChannelParameters {
244+ dust_limit_satoshis : self . dust_limit_satoshis ,
245+ max_htlc_value_in_flight_msat : self . max_htlc_value_in_flight_msat ,
246+ htlc_minimum_msat : self . htlc_minimum_msat ,
247+ commitment_feerate_sat_per_1000_weight : self . commitment_feerate_sat_per_1000_weight ,
248+ to_self_delay : self . to_self_delay ,
249+ max_accepted_htlcs : self . max_accepted_htlcs ,
250+ }
251+ }
252+ }
253+
254+ /// A subset of [`CommonOpenChannelFields`], containing various parameters which are set by the
255+ /// counterparty and which are not part of the channel funding transaction.
256+ #[ derive( Clone , Debug , Hash , PartialEq , Eq ) ]
257+ pub struct ChannelParameters {
258+ /// The threshold below which outputs on transactions broadcast by the channel initiator will be
259+ /// omitted
260+ pub dust_limit_satoshis : u64 ,
261+ /// The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
262+ pub max_htlc_value_in_flight_msat : u64 ,
263+ /// The minimum HTLC size incoming to channel initiator, in milli-satoshi
264+ pub htlc_minimum_msat : u64 ,
265+ /// The feerate for the commitment transaction set by the channel initiator until updated by
266+ /// [`UpdateFee`]
267+ pub commitment_feerate_sat_per_1000_weight : u32 ,
268+ /// The number of blocks which the counterparty will have to wait to claim on-chain funds if they
269+ /// broadcast a commitment transaction
270+ pub to_self_delay : u16 ,
271+ /// The maximum number of inbound HTLCs towards channel initiator
272+ pub max_accepted_htlcs : u16 ,
273+ }
274+
240275/// An [`open_channel`] message to be sent to or received from a peer.
241276///
242277/// Used in V1 channel establishment
0 commit comments