Class Scorer


  • public class Scorer
    extends Object
    [`Score`] implementation that provides reasonable default behavior. Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with slightly higher fees are available. Will further penalize channels that fail to relay payments. See [module-level documentation] for usage and [`ScoringParameters`] for customization. # Note Mixing the `no-std` feature between serialization and deserialization results in undefined behavior. [module-level documentation]: crate::routing::scoring
    • Method Detail

      • of

        public static Scorer of​(ScoringParameters params)
        Creates a new scorer using the given scoring parameters.
      • with_default

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

        public Score as_Score()
        Constructs a new Score which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
      • write

        public byte[] write()
        Serialize the Scorer object into a byte array which can be read by Scorer_read
      • read

        public static Result_ScorerDecodeErrorZ read​(byte[] ser)
        Read a Scorer from a byte array, created by Scorer_write