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.longget_overuse_penalty_msat_per_1024th()A penalty applied, per whole 1024ths of the channel capacity which the amount being sent over the channel exceeds [`overuse_penalty_start_1024th`] by.shortget_overuse_penalty_start_1024th()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`].static ScoringParametersof(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_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.voidset_overuse_penalty_msat_per_1024th(long 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.voidset_overuse_penalty_start_1024th(short 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`].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. Default value: 500 msat
-
set_base_penalty_msat
public void set_base_penalty_msat(long val)
A fixed penalty in msats to apply to each channel. Default value: 500 msat
-
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`] or when successfully routing through a channel. Default value: 1,024,000 msat [`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`] or when successfully routing through a channel. Default value: 1,024,000 msat [`failure_penalty_half_life`]: Self::failure_penalty_half_life
-
get_overuse_penalty_start_1024th
public short get_overuse_penalty_start_1024th()
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
-
set_overuse_penalty_start_1024th
public void set_overuse_penalty_start_1024th(short 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
-
get_overuse_penalty_msat_per_1024th
public long get_overuse_penalty_msat_per_1024th()
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
-
set_overuse_penalty_msat_per_1024th
public void set_overuse_penalty_msat_per_1024th(long 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
-
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. Successfully routing through a channel will immediately cut the penalty in half as well. # 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
-
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. Successfully routing through a channel will immediately cut the penalty in half as well. # 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
-
of
public static ScoringParameters of(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_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.
-
-