@@ -152,7 +152,7 @@ impl Readable for UserChannelId {
152
152
/// Details of a channel as returned by [`Node::list_channels`].
153
153
///
154
154
/// [`Node::list_channels`]: crate::Node::list_channels
155
- #[ derive( Debug , Clone , PartialEq , Eq ) ]
155
+ #[ derive( Debug , Clone ) ]
156
156
pub struct ChannelDetails {
157
157
/// The channel ID (prior to funding transaction generation, this is a random 32-byte
158
158
/// identifier, afterwards this is the transaction ID of the funding transaction XOR the
@@ -226,6 +226,52 @@ pub struct ChannelDetails {
226
226
/// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
227
227
/// the channel.
228
228
pub cltv_expiry_delta : Option < u16 > ,
229
+ /// The value, in satoshis, that must always be held in the channel for our counterparty. This
230
+ /// value ensures that if our counterparty broadcasts a revoked state, we can punish them by
231
+ /// claiming at least this value on chain.
232
+ ///
233
+ /// This value is not included in [`inbound_capacity_msat`] as it can never be spent.
234
+ ///
235
+ /// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
236
+ pub counterparty_unspendable_punishment_reserve : u64 ,
237
+ /// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
238
+ pub counterparty_outbound_htlc_minimum_msat : u64 ,
239
+ /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
240
+ pub counterparty_outbound_htlc_maximum_msat : Option < u64 > ,
241
+ /// Base routing fee in millisatoshis.
242
+ pub counterparty_forwarding_info_fee_base_msat : Option < u32 > ,
243
+ /// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi.
244
+ pub counterparty_forwarding_info_fee_proportional_millionths : Option < u32 > ,
245
+ /// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart,
246
+ /// such that the outgoing HTLC is forwardable to this counterparty.
247
+ pub counterparty_forwarding_info_cltv_expiry_delta : Option < u16 > ,
248
+ /// The available outbound capacity for sending a single HTLC to the remote peer. This is
249
+ /// similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
250
+ /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
251
+ /// to use a limit as close as possible to the HTLC limit we can currently send.
252
+ ///
253
+ /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
254
+ /// [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
255
+ pub next_outbound_htlc_limit_msat : u64 ,
256
+ /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
257
+ /// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
258
+ /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
259
+ /// route which is valid.
260
+ pub next_outbound_htlc_minimum_msat : u64 ,
261
+ /// The number of blocks (after our commitment transaction confirms) that we will need to wait
262
+ /// until we can claim our funds after we force-close the channel. During this time our
263
+ /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
264
+ /// force-closes the channel and broadcasts a commitment transaction we do not have to wait any
265
+ /// time to claim our non-HTLC-encumbered funds.
266
+ ///
267
+ /// This value will be `None` for outbound channels until the counterparty accepts the channel.
268
+ pub force_close_spend_delay : Option < u16 > ,
269
+ /// The smallest value HTLC (in msat) we will accept, for this channel.
270
+ pub inbound_htlc_minimum_msat : u64 ,
271
+ /// The largest value HTLC (in msat) we currently will accept, for this channel.
272
+ pub inbound_htlc_maximum_msat : Option < u64 > ,
273
+ /// Set of configurable parameters that affect channel operation.
274
+ pub config : Arc < ChannelConfig > ,
229
275
}
230
276
231
277
impl From < LdkChannelDetails > for ChannelDetails {
@@ -247,7 +293,36 @@ impl From<LdkChannelDetails> for ChannelDetails {
247
293
is_channel_ready : value. is_channel_ready ,
248
294
is_usable : value. is_usable ,
249
295
is_public : value. is_public ,
250
- cltv_expiry_delta : value. config . and_then ( |c| Some ( c. cltv_expiry_delta ) ) ,
296
+ cltv_expiry_delta : value. config . map ( |c| c. cltv_expiry_delta ) ,
297
+ counterparty_unspendable_punishment_reserve : value
298
+ . counterparty
299
+ . unspendable_punishment_reserve ,
300
+ counterparty_outbound_htlc_minimum_msat : value
301
+ . counterparty
302
+ . outbound_htlc_minimum_msat
303
+ . unwrap ( ) ,
304
+ counterparty_outbound_htlc_maximum_msat : value. counterparty . outbound_htlc_maximum_msat ,
305
+ counterparty_forwarding_info_fee_base_msat : value
306
+ . counterparty
307
+ . forwarding_info
308
+ . as_ref ( )
309
+ . map ( |f| f. fee_base_msat ) ,
310
+ counterparty_forwarding_info_fee_proportional_millionths : value
311
+ . counterparty
312
+ . forwarding_info
313
+ . as_ref ( )
314
+ . map ( |f| f. fee_proportional_millionths ) ,
315
+ counterparty_forwarding_info_cltv_expiry_delta : value
316
+ . counterparty
317
+ . forwarding_info
318
+ . as_ref ( )
319
+ . map ( |f| f. cltv_expiry_delta ) ,
320
+ next_outbound_htlc_limit_msat : value. next_outbound_htlc_limit_msat ,
321
+ next_outbound_htlc_minimum_msat : value. next_outbound_htlc_minimum_msat ,
322
+ force_close_spend_delay : value. force_close_spend_delay ,
323
+ inbound_htlc_minimum_msat : value. inbound_htlc_minimum_msat . unwrap ( ) ,
324
+ inbound_htlc_maximum_msat : value. inbound_htlc_maximum_msat ,
325
+ config : value. config . map ( |c| Arc :: new ( c. into ( ) ) ) . unwrap ( ) ,
251
326
}
252
327
}
253
328
}
0 commit comments