Package org.ldk.structs
Class Route
- java.lang.Object
-
- org.ldk.structs.Route
-
public class Route extends Object
A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, it can take multiple paths. Each path is composed of one or more hops through the network.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Routeclone()Creates a copy of the Routebooleaneq(Route b)Checks if two Routes contain equal inner contents.booleanequals(Object o)protected voidfinalize()RouteHop[][]get_paths()The list of routes taken for a single (potentially-)multi-part payment.PaymentParametersget_payment_params()The `payment_params` parameter passed to [`find_route`].longget_total_amount()Returns the total amount paid on this [`Route`], excluding the fees.longget_total_fees()Returns the total amount of fees paid on this [`Route`].longhash()Checks if two Routes contain equal inner contents.inthashCode()static Routeof(RouteHop[][] paths_arg, PaymentParameters payment_params_arg)Constructs a new Route given each fieldstatic Result_RouteDecodeErrorZread(byte[] ser)Read a Route from a byte array, created by Route_writevoidset_paths(RouteHop[][] val)The list of routes taken for a single (potentially-)multi-part payment.voidset_payment_params(PaymentParameters val)The `payment_params` parameter passed to [`find_route`].byte[]write()Serialize the Route object into a byte array which can be read by Route_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_paths
public RouteHop[][] get_paths()
The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the last RouteHop in each path must be the same. Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the destination. Thus, this must always be at least length one. While the maximum length of any given path is variable, keeping the length of any path less or equal to 19 should currently ensure it is viable.
-
set_paths
public void set_paths(RouteHop[][] val)
The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the last RouteHop in each path must be the same. Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the destination. Thus, this must always be at least length one. While the maximum length of any given path is variable, keeping the length of any path less or equal to 19 should currently ensure it is viable.
-
get_payment_params
@Nullable public PaymentParameters get_payment_params()
The `payment_params` parameter passed to [`find_route`]. This is used by `ChannelManager` to track information which may be required for retries, provided back to you via [`Event::PaymentPathFailed`]. [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_payment_params
public void set_payment_params(@Nullable PaymentParameters val)
The `payment_params` parameter passed to [`find_route`]. This is used by `ChannelManager` to track information which may be required for retries, provided back to you via [`Event::PaymentPathFailed`]. [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
of
public static Route of(RouteHop[][] paths_arg, PaymentParameters payment_params_arg)
Constructs a new Route given each field
-
hash
public long hash()
Checks if two Routes contain equal inner contents.
-
eq
public boolean eq(Route b)
Checks if two Routes contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
get_total_fees
public long get_total_fees()
Returns the total amount of fees paid on this [`Route`]. This doesn't include any extra payment made to the recipient, which can happen in excess of the amount passed to [`find_route`]'s `params.final_value_msat`.
-
get_total_amount
public long get_total_amount()
Returns the total amount paid on this [`Route`], excluding the fees.
-
write
public byte[] write()
Serialize the Route object into a byte array which can be read by Route_read
-
read
public static Result_RouteDecodeErrorZ read(byte[] ser)
Read a Route from a byte array, created by Route_write
-
-