Skip to content

Commit 40c7b46

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 81e006d commit 40c7b46

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

0 commit comments

Comments
 (0)