X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FRouteParameters.cs;h=35c04630acba2b25284177eb671f411eac43bc92;hb=c6777737ea14e7814b0fa7d6fe16536f31d4a82b;hp=1fa7af7a79f994a3d3d5df657a9124c9dda7acbc;hpb=ee72c84d4bf9e2404e02fe20155efb502ceaee1b;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/RouteParameters.cs b/c_sharp/src/org/ldk/structs/RouteParameters.cs index 1fa7af7a..35c04630 100644 --- a/c_sharp/src/org/ldk/structs/RouteParameters.cs +++ b/c_sharp/src/org/ldk/structs/RouteParameters.cs @@ -9,10 +9,7 @@ namespace org { namespace ldk { namespace structs { /** * Parameters needed to find a [`Route`]. * - * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in - * [`Event::PaymentPathFailed`] for retrying a failed payment path. - * - * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * Passed to [`find_route`] and [`build_route_from_hops`]. */ public class RouteParameters : CommonBase { internal RouteParameters(object _dummy, long ptr) : base(ptr) { } @@ -60,32 +57,13 @@ public class RouteParameters : CommonBase { GC.KeepAlive(val); } - /** - * The CLTV on the final hop of the failed payment path. - */ - public int get_final_cltv_expiry_delta() { - int ret = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The CLTV on the final hop of the failed payment path. - */ - public void set_final_cltv_expiry_delta(int val) { - bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * Constructs a new RouteParameters given each field */ - public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg) { - long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg, final_cltv_expiry_delta_arg); + public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg) { + long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg); GC.KeepAlive(payment_params_arg); GC.KeepAlive(final_value_msat_arg); - GC.KeepAlive(final_cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } 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.AddLast(ret_hu_conv); }; @@ -111,6 +89,23 @@ public class RouteParameters : CommonBase { return ret_hu_conv; } + /** + * Checks if two RouteParameterss 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. + */ + public bool eq(org.ldk.structs.RouteParameters b) { + bool ret = bindings.RouteParameters_eq(this.ptr, b == null ? 0 : b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is RouteParameters)) return false; + return this.eq((RouteParameters)o); + } /** * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read */