Skip to content

Commit 62b5493

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 5922cc4 commit 62b5493

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
@@ -388,10 +388,8 @@ pub struct ChannelCounterparty {
388388
/// Information on the fees and requirements that the counterparty requires when forwarding
389389
/// payments to us through this channel.
390390
pub forwarding_info: Option<CounterpartyForwardingInfo>,
391-
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
392-
/// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
393-
/// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
394-
pub outbound_htlc_minimum_msat: Option<u64>,
391+
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
392+
pub outbound_htlc_minimum_msat: u64,
395393
/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
396394
pub outbound_htlc_maximum_msat: Option<u64>,
397395
}
@@ -630,7 +628,9 @@ impl ChannelDetails {
630628
features: maybe_wrap(value.counterparty.features),
631629
unspendable_punishment_reserve: value.counterparty.unspendable_punishment_reserve,
632630
forwarding_info: value.counterparty.forwarding_info,
633-
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat,
631+
// unwrap safety: This value will be `None` for objects serialized with LDK versions
632+
// prior to 0.0.115.
633+
outbound_htlc_minimum_msat: value.counterparty.outbound_htlc_minimum_msat.unwrap(),
634634
outbound_htlc_maximum_msat: value.counterparty.outbound_htlc_maximum_msat,
635635
},
636636
funding_txo: value.funding_txo.map(|o| o.into_bitcoin_outpoint()),

0 commit comments

Comments
 (0)