Class 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 Detail

      • 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
      • clone

        public Route clone()
        Creates a copy of the Route
        Overrides:
        clone in class Object
      • hash

        public long hash()
        Checks if two Routes contain equal inner contents.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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