X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPhantomRouteHints.java;h=680ad1cdb7ce54e45d8fcb7c8ba6a77cc9743359;hb=8fa2bcb208a51fa352d04981f1387d8bceced107;hp=459a06fa03bb6b3dfaa82ec27036e81875a640eb;hpb=d941cc4e66ea53ce81912a04d35b164344f3a7ee;p=ldk-java diff --git a/src/main/java/org/ldk/structs/PhantomRouteHints.java b/src/main/java/org/ldk/structs/PhantomRouteHints.java index 459a06fa..680ad1cd 100644 --- a/src/main/java/org/ldk/structs/PhantomRouteHints.java +++ b/src/main/java/org/ldk/structs/PhantomRouteHints.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; /** * Route hints used in constructing invoices for [phantom node payents]. * - * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + * [phantom node payments]: crate::sign::PhantomKeysManager */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class PhantomRouteHints extends CommonBase { @@ -32,8 +32,8 @@ public class PhantomRouteHints extends CommonBase { ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); } - ret_conv_16_hu_conv.ptrs_to.add(this); + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } + if (ret_conv_16_hu_conv != null) { ret_conv_16_hu_conv.ptrs_to.add(this); }; ret_conv_16_arr[q] = ret_conv_16_hu_conv; } return ret_conv_16_arr; @@ -43,9 +43,10 @@ public class PhantomRouteHints extends CommonBase { * The list of channels to be included in the invoice route hints. */ public void set_channels(ChannelDetails[] val) { - bindings.PhantomRouteHints_set_channels(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray() : null); + bindings.PhantomRouteHints_set_channels(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr).toArray() : null); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + for (ChannelDetails val_conv_16: val) { if (this != null) { this.ptrs_to.add(val_conv_16); }; }; } /** @@ -90,13 +91,14 @@ public class PhantomRouteHints extends CommonBase { * Constructs a new PhantomRouteHints given each field */ public static PhantomRouteHints of(ChannelDetails[] channels_arg, long phantom_scid_arg, byte[] real_node_pubkey_arg) { - long ret = bindings.PhantomRouteHints_new(channels_arg != null ? Arrays.stream(channels_arg).mapToLong(channels_arg_conv_16 -> channels_arg_conv_16 == null ? 0 : channels_arg_conv_16.ptr & ~1).toArray() : null, phantom_scid_arg, InternalUtils.check_arr_len(real_node_pubkey_arg, 33)); + long ret = bindings.PhantomRouteHints_new(channels_arg != null ? Arrays.stream(channels_arg).mapToLong(channels_arg_conv_16 -> channels_arg_conv_16 == null ? 0 : channels_arg_conv_16.ptr).toArray() : null, phantom_scid_arg, InternalUtils.check_arr_len(real_node_pubkey_arg, 33)); Reference.reachabilityFence(channels_arg); Reference.reachabilityFence(phantom_scid_arg); Reference.reachabilityFence(real_node_pubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } - PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomRouteHints(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); + org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + for (ChannelDetails channels_arg_conv_16: channels_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channels_arg_conv_16); }; }; return ret_hu_conv; } @@ -113,8 +115,8 @@ public class PhantomRouteHints extends CommonBase { long ret = bindings.PhantomRouteHints_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomRouteHints(null, ret); } - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }