Package org.ldk.structs
Class Scorer
- java.lang.Object
-
- org.ldk.structs.Scorer
-
public class Scorer extends Object
[`routing::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. [module-level documentation]: crate::routing::scorer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Scoreas_Score()Constructs a new Score which calls the relevant methods on this_arg.protected voidfinalize()static Scorerof(long params_base_penalty_msat_arg, long params_failure_penalty_msat_arg, long params_failure_penalty_half_life_arg)Creates a new scorer using the given scoring parameters.static Result_ScorerDecodeErrorZread(byte[] ser)Read a Scorer from a byte array, created by Scorer_writestatic Scorerwith_default()Creates a "default" Scorer.byte[]write()Serialize the Scorer object into a byte array which can be read by Scorer_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
of
public static Scorer of(long params_base_penalty_msat_arg, long params_failure_penalty_msat_arg, long params_failure_penalty_half_life_arg)
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
-
-