Class ScoringParameters


  • public class ScoringParameters
    extends Object
    Parameters for configuring [`Scorer`].
    • Method Detail

      • 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
      • with_default

        public static ScoringParameters with_default()
        Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.