Package org.ldk.structs
Class ScoringParameters
- java.lang.Object
-
- org.ldk.structs.ScoringParameters
-
public class ScoringParameters extends Object
Parameters for configuring [`Scorer`].
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()longget_base_penalty_msat()A fixed penalty in msats to apply to each channel.longget_failure_penalty_half_life()The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are cut in half.longget_failure_penalty_msat()A penalty in msats to apply to a channel upon failing to relay a payment.static ScoringParametersof(long base_penalty_msat_arg, long failure_penalty_msat_arg, long failure_penalty_half_life_arg)Constructs a new ScoringParameters given each fieldstatic Result_ScoringParametersDecodeErrorZread(byte[] ser)Read a ScoringParameters from a byte array, created by ScoringParameters_writevoidset_base_penalty_msat(long val)A fixed penalty in msats to apply to each channel.voidset_failure_penalty_half_life(long val)The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are cut in half.voidset_failure_penalty_msat(long val)A penalty in msats to apply to a channel upon failing to relay a payment.static ScoringParameterswith_default()Creates a "default" ScoringParameters.byte[]write()Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_base_penalty_msat
public long get_base_penalty_msat()
A fixed penalty in msats to apply to each channel.
-
set_base_penalty_msat
public void set_base_penalty_msat(long val)
A fixed penalty in msats to apply to each channel.
-
get_failure_penalty_msat
public long get_failure_penalty_msat()
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`]. [`failure_penalty_half_life`]: Self::failure_penalty_half_life
-
set_failure_penalty_msat
public void set_failure_penalty_msat(long 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`]. [`failure_penalty_half_life`]: Self::failure_penalty_half_life
-
get_failure_penalty_half_life
public long get_failure_penalty_half_life()
The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are cut in half. # Note When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never elapse. Therefore, this penalty will never decay. [`failure_penalty_msat`]: Self::failure_penalty_msat
-
set_failure_penalty_half_life
public void set_failure_penalty_half_life(long val)
The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are cut in half. # Note When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never elapse. Therefore, this penalty will never decay. [`failure_penalty_msat`]: Self::failure_penalty_msat
-
of
public static ScoringParameters of(long base_penalty_msat_arg, long failure_penalty_msat_arg, long failure_penalty_half_life_arg)
Constructs a new ScoringParameters given each field
-
write
public byte[] write()
Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
-
read
public static Result_ScoringParametersDecodeErrorZ read(byte[] ser)
Read a ScoringParameters from a byte array, created by ScoringParameters_write
-
with_default
public static ScoringParameters with_default()
Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
-
-