X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRoute.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRoute.java;h=03b591178b930589c8217bba237d39e73070798b;hb=07d5d868dfe064aadb28a7f7ca6002c16be9723d;hp=fc1b94fb15aaf010225928bb5e046cc8446c016d;hpb=32973ea2749f8efd05b543dd774763513013b38b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index fc1b94fb..03b59117 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -53,31 +53,35 @@ public class Route extends CommonBase { } /** - * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`]. + * 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 */ @Nullable - public PaymentParameters get_payment_params() { - long ret = bindings.Route_get_payment_params(this.ptr); + public RouteParameters get_route_params() { + long ret = bindings.Route_get_route_params(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } + org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`]. + * 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 */ - public void set_payment_params(@Nullable org.ldk.structs.PaymentParameters val) { - bindings.Route_set_payment_params(this.ptr, val == null ? 0 : val.ptr); + public void set_route_params(@Nullable org.ldk.structs.RouteParameters val) { + bindings.Route_set_route_params(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); if (this != null) { this.ptrs_to.add(val); }; @@ -85,16 +89,18 @@ public class Route extends CommonBase { /** * 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 */ - public static Route of(Path[] paths_arg, org.ldk.structs.PaymentParameters payment_params_arg) { - long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).mapToLong(paths_arg_conv_6 -> paths_arg_conv_6 == null ? 0 : paths_arg_conv_6.ptr).toArray() : null, payment_params_arg == null ? 0 : payment_params_arg.ptr); + public static Route of(Path[] paths_arg, @Nullable org.ldk.structs.RouteParameters route_params_arg) { + long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).mapToLong(paths_arg_conv_6 -> paths_arg_conv_6 == null ? 0 : paths_arg_conv_6.ptr).toArray() : null, route_params_arg == null ? 0 : route_params_arg.ptr); Reference.reachabilityFence(paths_arg); - Reference.reachabilityFence(payment_params_arg); + Reference.reachabilityFence(route_params_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; for (Path paths_arg_conv_6: paths_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(paths_arg_conv_6); }; }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_params_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params_arg); }; return ret_hu_conv; } @@ -148,8 +154,11 @@ public class Route extends CommonBase { /** * 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 `route_params.final_value_msat`. + * 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 */ public long get_total_fees() { long ret = bindings.Route_get_total_fees(this.ptr); @@ -158,8 +167,12 @@ public class Route extends CommonBase { } /** - * Returns the total amount paid on this [`Route`], excluding the fees. Might be more than - * requested if we had to reach htlc_minimum_msat. + * 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 */ public long get_total_amount() { long ret = bindings.Route_get_total_amount(this.ptr);