Class ScoreLookUp


  • public class ScoreLookUp
    extends Object
    An interface used to score payment channels for path finding. `ScoreLookUp` is used to determine the penalty for a given channel. Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • channel_penalty_msat

        public long channel_penalty_msat​(long short_channel_id,
                                         NodeId source,
                                         NodeId target,
                                         ChannelUsage usage,
                                         ProbabilisticScoringFeeParameters score_params)
        Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the given channel in the direction from `source` to `target`. The channel's capacity (less any other MPP parts that are also being considered for use in the same payment) is given by `capacity_msat`. It may be determined from various sources such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. Thus, implementations should be overflow-safe.