- if (ret < 1024) { return null; }
- ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
- ret_hu_conv.ptrs_to.add(this);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable
+ public ChannelUpdateInfo get_directional_info(byte channel_flags) {
+ long ret = bindings.ChannelInfo_get_directional_info(this.ptr, channel_flags);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_flags);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };