Package org.ldk.structs
Class Score
- java.lang.Object
-
- org.ldk.structs.Score
-
public class Score extends Object
An interface used to score payment channels for path finding. \tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceScore.ScoreInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longchannel_penalty_msat(long short_channel_id, long send_amt_msat, Option_u64Z channel_capacity_msat, NodeId source, NodeId target)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`.protected voidfinalize()static Scorenew_impl(Score.ScoreInterface arg)voidpayment_path_failed(RouteHop[] path, long short_channel_id)Handles updating channel penalties after failing to route through a channel.voidpayment_path_successful(RouteHop[] path)Handles updating channel penalties after successfully routing along a path.byte[]write()Serialize the object into a byte array
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
new_impl
public static Score new_impl(Score.ScoreInterface arg)
-
channel_penalty_msat
public long channel_penalty_msat(long short_channel_id, long send_amt_msat, Option_u64Z channel_capacity_msat, NodeId source, NodeId target)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 which are also being considered for use in the same payment) is given by `channel_capacity_msat`. It may be guessed from various sources or assumed from no data at all. For hints provided in the invoice, we assume the channel has sufficient capacity to accept the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other cases it is set to `Some`, even if we're guessing at the channel value. Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
-
payment_path_failed
public void payment_path_failed(RouteHop[] path, long short_channel_id)
Handles updating channel penalties after failing to route through a channel.
-
payment_path_successful
public void payment_path_successful(RouteHop[] path)
Handles updating channel penalties after successfully routing along a path.
-
write
public byte[] write()
Serialize the object into a byte array
-
-