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()Path[]get_paths()The list of [`Path`]s taken for a single (potentially-)multi-part payment.RouteParametersget_route_params()The `route_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()Generates a non-cryptographic 64-bit hash of the Route.inthashCode()static Routeof(Path[] paths_arg, RouteParameters route_params_arg)Constructs a new Route given each field Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent Nonestatic Result_RouteDecodeErrorZread(byte[] ser)Read a Route from a byte array, created by Route_writevoidset_paths(Path[] val)The list of [`Path`]s taken for a single (potentially-)multi-part payment.voidset_route_params(RouteParameters val)The `route_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 Path[] get_paths()
The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be the same.
-
set_paths
public void set_paths(Path[] val)
The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be the same.
-
get_route_params
@Nullable public RouteParameters get_route_params()
The `route_params` parameter passed to [`find_route`]. This is used by `ChannelManager` to track information which may be required for retries. Will be `None` for objects serialized with LDK versions prior to 0.0.117. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_route_params
public void set_route_params(@Nullable RouteParameters val)
The `route_params` parameter passed to [`find_route`]. This is used by `ChannelManager` to track information which may be required for retries. Will be `None` for objects serialized with LDK versions prior to 0.0.117. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
of
public static Route of(Path[] paths_arg, @Nullable RouteParameters route_params_arg)
Constructs a new Route given each field Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
-
hash
public long hash()
Generates a non-cryptographic 64-bit hash of the Route.
-
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`]. For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to the recipient, which can happen in excess of the amount passed to [`find_route`] via [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits. [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
-
get_total_amount
public long get_total_amount()
Returns the total amount paid on this [`Route`], excluding the fees. Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if we had to reach the [`htlc_minimum_msat`] limits. [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
-
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
-
-