@@ -922,6 +922,12 @@ pub struct ChannelCounterparty {
922
922
/// Information on the fees and requirements that the counterparty requires when forwarding
923
923
/// payments to us through this channel.
924
924
pub forwarding_info : Option < CounterpartyForwardingInfo > ,
925
+ /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
926
+ /// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
927
+ /// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
928
+ pub outbound_htlc_minimum_msat : Option < u64 > ,
929
+ /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
930
+ pub outbound_htlc_maximum_msat : Option < u64 > ,
925
931
}
926
932
927
933
/// Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
@@ -1046,6 +1052,11 @@ pub struct ChannelDetails {
1046
1052
pub is_usable : bool ,
1047
1053
/// True if this channel is (or will be) publicly-announced.
1048
1054
pub is_public : bool ,
1055
+ /// The smallest value HTLC (in msat) we will accept, for this channel. This field
1056
+ /// is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
1057
+ pub inbound_htlc_minimum_msat : Option < u64 > ,
1058
+ /// The largest value HTLC (in msat) we currently will accept, for this channel.
1059
+ pub inbound_htlc_maximum_msat : Option < u64 > ,
1049
1060
}
1050
1061
1051
1062
impl ChannelDetails {
@@ -1670,6 +1681,14 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1670
1681
features : InitFeatures :: empty ( ) ,
1671
1682
unspendable_punishment_reserve : to_remote_reserve_satoshis,
1672
1683
forwarding_info : channel. counterparty_forwarding_info ( ) ,
1684
+ // Ensures that we have actually received the `htlc_minimum_msat` value
1685
+ // from the counterparty through the `OpenChannel` or `AcceptChannel`
1686
+ // message (as they are always the first message from the counterparty).
1687
+ // Else `Channel::get_counterparty_htlc_minimum_msat` could return the
1688
+ // default `0` value set by `Channel::new_outbound`.
1689
+ outbound_htlc_minimum_msat : if channel. have_received_message ( ) {
1690
+ Some ( channel. get_counterparty_htlc_minimum_msat ( ) ) } else { None } ,
1691
+ outbound_htlc_maximum_msat : channel. get_counterparty_htlc_maximum_msat ( ) ,
1673
1692
} ,
1674
1693
funding_txo : channel. get_funding_txo ( ) ,
1675
1694
// Note that accept_channel (or open_channel) is always the first message, so
@@ -1689,6 +1708,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1689
1708
is_funding_locked : channel. is_usable ( ) ,
1690
1709
is_usable : channel. is_live ( ) ,
1691
1710
is_public : channel. should_announce ( ) ,
1711
+ inbound_htlc_minimum_msat : Some ( channel. get_holder_htlc_minimum_msat ( ) ) ,
1712
+ inbound_htlc_maximum_msat : channel. get_holder_htlc_maximum_msat ( )
1692
1713
} ) ;
1693
1714
}
1694
1715
}
@@ -5900,6 +5921,8 @@ impl_writeable_tlv_based!(ChannelCounterparty, {
5900
5921
( 4 , features, required) ,
5901
5922
( 6 , unspendable_punishment_reserve, required) ,
5902
5923
( 8 , forwarding_info, option) ,
5924
+ ( 9 , outbound_htlc_minimum_msat, option) ,
5925
+ ( 11 , outbound_htlc_maximum_msat, option) ,
5903
5926
} ) ;
5904
5927
5905
5928
impl_writeable_tlv_based ! ( ChannelDetails , {
@@ -5921,6 +5944,8 @@ impl_writeable_tlv_based!(ChannelDetails, {
5921
5944
( 28 , is_funding_locked, required) ,
5922
5945
( 30 , is_usable, required) ,
5923
5946
( 32 , is_public, required) ,
5947
+ ( 33 , inbound_htlc_minimum_msat, option) ,
5948
+ ( 35 , inbound_htlc_maximum_msat, option) ,
5924
5949
} ) ;
5925
5950
5926
5951
impl_writeable_tlv_based ! ( PhantomRouteHints , {
0 commit comments