Skip to content

Commit c02bcd3

Browse files
committed
fixup! Expose per-channel features in ChannelDetails
Unwrap `outbound_htlc_minimum_msat` and change its type from `Option<u64>` to `u64` in `ChannelCounterparty`. The `None` case only existed for LDK objects serialized prior to 0.0.107, and ldk-node has never shipped with an LDK version that old. Rewrites the documentation to address wrongly referencing LDK release.
1 parent 442b9d8 commit c02bcd3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/types.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,8 @@ pub struct ChannelCounterparty {
418418
/// Information on the fees and requirements that the counterparty requires when forwarding
419419
/// payments to us through this channel.
420420
pub forwarding_info: Option<CounterpartyForwardingInfo>,
421-
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
422-
/// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
423-
/// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
424-
pub outbound_htlc_minimum_msat: Option<u64>,
421+
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
422+
pub outbound_htlc_minimum_msat: u64,
425423
/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
426424
pub outbound_htlc_maximum_msat: Option<u64>,
427425
}
@@ -660,7 +658,9 @@ impl ChannelDetails {
660658
features: maybe_wrap(value.counterparty.features),
661659
unspendable_punishment_reserve: value.counterparty.unspendable_punishment_reserve,
662660
forwarding_info: value.counterparty.forwarding_info,
663-
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat,
661+
// unwrap safety: This value will be `None` for objects serialized with LDK versions
662+
// prior to 0.0.115.
663+
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat.unwrap(),
664664
outbound_htlc_maximum_msat: value.counterparty.outbound_htlc_maximum_msat,
665665
},
666666
funding_txo: value.funding_txo.map(|o| o.into_bitcoin_outpoint()),

0 commit comments

Comments
 (0)