Skip to content

Commit 5289b18

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 41ddcdc commit 5289b18

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
@@ -419,10 +419,8 @@ pub struct ChannelCounterparty {
419419
/// Information on the fees and requirements that the counterparty requires when forwarding
420420
/// payments to us through this channel.
421421
pub forwarding_info: Option<CounterpartyForwardingInfo>,
422-
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
423-
/// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
424-
/// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
425-
pub outbound_htlc_minimum_msat: Option<u64>,
422+
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
423+
pub outbound_htlc_minimum_msat: u64,
426424
/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
427425
pub outbound_htlc_maximum_msat: Option<u64>,
428426
}
@@ -661,7 +659,9 @@ impl ChannelDetails {
661659
features: maybe_wrap(value.counterparty.features),
662660
unspendable_punishment_reserve: value.counterparty.unspendable_punishment_reserve,
663661
forwarding_info: value.counterparty.forwarding_info,
664-
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat,
662+
// unwrap safety: This value will be `None` for objects serialized with LDK versions
663+
// prior to 0.0.115.
664+
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat.unwrap(),
665665
outbound_htlc_maximum_msat: value.counterparty.outbound_htlc_maximum_msat,
666666
},
667667
funding_txo: value.funding_txo.map(|o| o.into_bitcoin_outpoint()),

0 commit comments

Comments
 (0)