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 Route
clone()
Creates a copy of the Routeboolean
eq(Route b)
Checks if two Routes contain equal inner contents.protected void
finalize()
RouteHop[][]
get_paths()
The list of routes taken for a single (potentially-)multi-part payment.long
get_total_amount()
Returns the total amount paid on this [`Route`], excluding the fees.long
get_total_fees()
Returns the total amount of fees paid on this [`Route`].long
hash()
Checks if two Routes contain equal inner contents.static Route
of(RouteHop[][] paths_arg)
Constructs a new Route given each fieldstatic Result_RouteDecodeErrorZ
read(byte[] ser)
Read a Route from a byte array, created by Route_writevoid
set_paths(RouteHop[][] val)
The list of routes taken for a single (potentially-)multi-part payment.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 to less than 20 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 to less than 20 should currently ensure it is viable.
-
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 [`get_route`]'s `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
-
-