-/// A fixed penalty in msats to apply to each channel.
-///
-/// Default value: 500 msat
-#[no_mangle]
-pub extern "C" fn ScoringParameters_get_base_penalty_msat(this_ptr: &ScoringParameters) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().base_penalty_msat;
- *inner_val
-}
-/// A fixed penalty in msats to apply to each channel.
-///
-/// Default value: 500 msat
-#[no_mangle]
-pub extern "C" fn ScoringParameters_set_base_penalty_msat(this_ptr: &mut ScoringParameters, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.base_penalty_msat = val;
-}
-/// A penalty in msats to apply to a channel upon failing to relay a payment.
-///
-/// This accumulates for each failure but may be reduced over time based on
-/// [`failure_penalty_half_life`] or when successfully routing through a channel.
-///
-/// Default value: 1,024,000 msat
-///
-/// [`failure_penalty_half_life`]: Self::failure_penalty_half_life
-#[no_mangle]
-pub extern "C" fn ScoringParameters_get_failure_penalty_msat(this_ptr: &ScoringParameters) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().failure_penalty_msat;
- *inner_val
-}
-/// A penalty in msats to apply to a channel upon failing to relay a payment.
-///
-/// This accumulates for each failure but may be reduced over time based on
-/// [`failure_penalty_half_life`] or when successfully routing through a channel.
-///
-/// Default value: 1,024,000 msat
-///
-/// [`failure_penalty_half_life`]: Self::failure_penalty_half_life
-#[no_mangle]
-pub extern "C" fn ScoringParameters_set_failure_penalty_msat(this_ptr: &mut ScoringParameters, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.failure_penalty_msat = val;
-}
-/// When the amount being sent over a channel is this many 1024ths of the total channel
-/// capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
-///
-/// Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
-///
-/// [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
-#[no_mangle]
-pub extern "C" fn ScoringParameters_get_overuse_penalty_start_1024th(this_ptr: &ScoringParameters) -> u16 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().overuse_penalty_start_1024th;
- *inner_val
-}
-/// When the amount being sent over a channel is this many 1024ths of the total channel
-/// capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
-///
-/// Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
-///
-/// [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
-#[no_mangle]
-pub extern "C" fn ScoringParameters_set_overuse_penalty_start_1024th(this_ptr: &mut ScoringParameters, mut val: u16) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.overuse_penalty_start_1024th = val;
-}
-/// A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
-/// over the channel exceeds [`overuse_penalty_start_1024th`] by.
-///
-/// Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
-/// to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
-///
-/// [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
-#[no_mangle]
-pub extern "C" fn ScoringParameters_get_overuse_penalty_msat_per_1024th(this_ptr: &ScoringParameters) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().overuse_penalty_msat_per_1024th;
- *inner_val
-}
-/// A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
-/// over the channel exceeds [`overuse_penalty_start_1024th`] by.
-///
-/// Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
-/// to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
-///
-/// [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
-#[no_mangle]
-pub extern "C" fn ScoringParameters_set_overuse_penalty_msat_per_1024th(this_ptr: &mut ScoringParameters, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.overuse_penalty_msat_per_1024th = val;
-}
-/// The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
-/// cut in half.
-///
-/// Successfully routing through a channel will immediately cut the penalty in half as well.
-///
-/// Default value: 1 hour
-///
-/// # Note
-///
-/// When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
-/// never decay.
-///
-/// [`failure_penalty_msat`]: Self::failure_penalty_msat
-#[no_mangle]
-pub extern "C" fn ScoringParameters_get_failure_penalty_half_life(this_ptr: &ScoringParameters) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().failure_penalty_half_life;
- inner_val.as_secs()
-}
-/// The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
-/// cut in half.
-///
-/// Successfully routing through a channel will immediately cut the penalty in half as well.
-///
-/// Default value: 1 hour
-///
-/// # Note
-///
-/// When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
-/// never decay.
-///
-/// [`failure_penalty_msat`]: Self::failure_penalty_msat
-#[no_mangle]
-pub extern "C" fn ScoringParameters_set_failure_penalty_half_life(this_ptr: &mut ScoringParameters, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.failure_penalty_half_life = core::time::Duration::from_secs(val);
-}
-/// Constructs a new ScoringParameters given each field
-#[must_use]
-#[no_mangle]
-pub extern "C" fn ScoringParameters_new(mut base_penalty_msat_arg: u64, mut failure_penalty_msat_arg: u64, mut overuse_penalty_start_1024th_arg: u16, mut overuse_penalty_msat_per_1024th_arg: u64, mut failure_penalty_half_life_arg: u64) -> ScoringParameters {
- ScoringParameters { inner: ObjOps::heap_alloc(nativeScoringParameters {
- base_penalty_msat: base_penalty_msat_arg,
- failure_penalty_msat: failure_penalty_msat_arg,
- overuse_penalty_start_1024th: overuse_penalty_start_1024th_arg,
- overuse_penalty_msat_per_1024th: overuse_penalty_msat_per_1024th_arg,
- failure_penalty_half_life: core::time::Duration::from_secs(failure_penalty_half_life_arg),
- }), is_owned: true }
-}
-impl Clone for ScoringParameters {