/// any attacker who is able to take control of a channel can just as easily send the funds via
/// lightning payments, so we never require that our counterparties support this option.
///
-/// The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
+/// The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
///
/// Default value: true.
///
-/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+/// [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
#[no_mangle]
pub extern "C" fn ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(this_ptr: &ChannelHandshakeConfig) -> bool {
let mut inner_val = &mut this_ptr.get_native_mut_ref().commit_upfront_shutdown_pubkey;
/// any attacker who is able to take control of a channel can just as easily send the funds via
/// lightning payments, so we never require that our counterparties support this option.
///
-/// The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
+/// The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
///
/// Default value: true.
///
-/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+/// [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
#[no_mangle]
pub extern "C" fn ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(this_ptr: &mut ChannelHandshakeConfig, mut val: bool) {
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.commit_upfront_shutdown_pubkey = val;
pub extern "C" fn ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(this_ptr: &mut ChannelHandshakeConfig, mut val: u32) {
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.their_channel_reserve_proportional_millionths = val;
}
+/// The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
+///
+/// Increasing the value can help improve liquidity and stability in
+/// routing at the cost of higher long term disk / DB usage.
+///
+/// Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
+/// other than the default value.
+///
+/// Default value: 50
+/// Maximum value: 483, any values larger will be treated as 483.
+/// This is the BOLT #2 spec limit on `max_accepted_htlcs`.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_get_our_max_accepted_htlcs(this_ptr: &ChannelHandshakeConfig) -> u16 {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().our_max_accepted_htlcs;
+ *inner_val
+}
+/// The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
+///
+/// Increasing the value can help improve liquidity and stability in
+/// routing at the cost of higher long term disk / DB usage.
+///
+/// Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
+/// other than the default value.
+///
+/// Default value: 50
+/// Maximum value: 483, any values larger will be treated as 483.
+/// This is the BOLT #2 spec limit on `max_accepted_htlcs`.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_set_our_max_accepted_htlcs(this_ptr: &mut ChannelHandshakeConfig, mut val: u16) {
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.our_max_accepted_htlcs = val;
+}
/// Constructs a new ChannelHandshakeConfig given each field
#[must_use]
#[no_mangle]
-pub extern "C" fn ChannelHandshakeConfig_new(mut minimum_depth_arg: u32, mut our_to_self_delay_arg: u16, mut our_htlc_minimum_msat_arg: u64, mut max_inbound_htlc_value_in_flight_percent_of_channel_arg: u8, mut negotiate_scid_privacy_arg: bool, mut announced_channel_arg: bool, mut commit_upfront_shutdown_pubkey_arg: bool, mut their_channel_reserve_proportional_millionths_arg: u32) -> ChannelHandshakeConfig {
+pub extern "C" fn ChannelHandshakeConfig_new(mut minimum_depth_arg: u32, mut our_to_self_delay_arg: u16, mut our_htlc_minimum_msat_arg: u64, mut max_inbound_htlc_value_in_flight_percent_of_channel_arg: u8, mut negotiate_scid_privacy_arg: bool, mut announced_channel_arg: bool, mut commit_upfront_shutdown_pubkey_arg: bool, mut their_channel_reserve_proportional_millionths_arg: u32, mut our_max_accepted_htlcs_arg: u16) -> ChannelHandshakeConfig {
ChannelHandshakeConfig { inner: ObjOps::heap_alloc(nativeChannelHandshakeConfig {
minimum_depth: minimum_depth_arg,
our_to_self_delay: our_to_self_delay_arg,
announced_channel: announced_channel_arg,
commit_upfront_shutdown_pubkey: commit_upfront_shutdown_pubkey_arg,
their_channel_reserve_proportional_millionths: their_channel_reserve_proportional_millionths_arg,
+ our_max_accepted_htlcs: our_max_accepted_htlcs_arg,
}), is_owned: true }
}
impl Clone for ChannelHandshakeConfig {
///
/// These limits are only applied to our counterparty's limits, not our own.
///
-/// Use 0/<type>::max_value() as appropriate to skip checking.
+/// Use 0/`<type>::max_value()` as appropriate to skip checking.
///
/// Provides sane defaults for most configurations.
///
///
/// Default value: false.
///
-/// [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
+/// [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
/// [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
/// [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
#[no_mangle]
///
/// Default value: false.
///
-/// [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
+/// [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
/// [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
/// [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
#[no_mangle]
/// Default value: false.
///
/// [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
-/// [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
+/// [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
#[no_mangle]
pub extern "C" fn UserConfig_get_accept_intercept_htlcs(this_ptr: &UserConfig) -> bool {
let mut inner_val = &mut this_ptr.get_native_mut_ref().accept_intercept_htlcs;
/// Default value: false.
///
/// [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
-/// [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
+/// [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
#[no_mangle]
pub extern "C" fn UserConfig_set_accept_intercept_htlcs(this_ptr: &mut UserConfig, mut val: bool) {
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.accept_intercept_htlcs = val;