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.boolean
equals(Object o)
protected void
finalize()
Path[]
get_paths()
The list of [`Path`]s taken for a single (potentially-)multi-part payment.PaymentParameters
get_payment_params()
The `payment_params` parameter passed to [`find_route`].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()
Generates a non-cryptographic 64-bit hash of the Route.int
hashCode()
static Route
of(Path[] paths_arg, PaymentParameters payment_params_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(Path[] val)
The list of [`Path`]s taken for a single (potentially-)multi-part payment.void
set_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 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_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::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::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(Path[] paths_arg, PaymentParameters payment_params_arg)
Constructs a new Route given each field
-
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`]. 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. Might be more than requested if we had to reach htlc_minimum_msat.
-
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
-
-